Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support move language v6 and new gas meter #3838

Merged
merged 72 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
5de1500
[compiler] update move
LemonHX Jun 2, 2022
8e321b4
Merge branch 'master' into update_move
LemonHX Jun 6, 2022
11eaff5
gen new stdlib
LemonHX Jun 6, 2022
d9fabca
fix warning: add phantom for merkle distributor
LemonHX Jun 9, 2022
3f50159
update move version
LemonHX Jun 22, 2022
e03b64b
fix Identifier merge
LemonHX Jun 23, 2022
a8bd54b
Update module_upgrade_test.rs
LemonHX Jun 25, 2022
fcb85fc
update script
LemonHX Jun 30, 2022
d26b12e
Merge branch 'master' into update_move
LemonHX Jun 30, 2022
5c4d0b3
check commit
LemonHX Jun 30, 2022
76d7894
1.add table native functions
nkysg Jul 7, 2022
1fd0799
1.add StateKey,MoveExt, SessionId,MoveResolveExt
nkysg Jul 7, 2022
71ed0a5
Merge branch 'master' into update_move
nkysg Jul 7, 2022
70786de
add contract_api.json
nkysg Jul 7, 2022
ab68cbc
1.add halley genesis
nkysg Jul 7, 2022
a86860a
gen new stdlib
nkysg Jul 7, 2022
50ee42a
Merge branch 'master' into update_move
LemonHX Jul 11, 2022
91da2b2
Merge branch 'master' into update_move
LemonHX Jul 11, 2022
532470c
fix lock
LemonHX Jul 11, 2022
38b1122
update move repo
nkysg Jul 11, 2022
ad56d3e
add move table extension flush
nkysg Jul 11, 2022
0c50094
add statedb support move table extension with commit and flush
nkysg Jul 12, 2022
c89762d
remove WriteAccessPathSet and refactor code
nkysg Jul 12, 2022
7abd16f
Merge branch 'master' into update_move
nkysg Jul 12, 2022
0924d4d
remove unused code
nkysg Jul 12, 2022
df4c523
add halley genesis
nkysg Jul 13, 2022
3529979
add halley genesis
nkysg Jul 13, 2022
f2e99da
remove file
nkysg Jul 13, 2022
e0c0e95
fix bug
nkysg Jul 13, 2022
8090bd2
add halley genesis
nkysg Jul 13, 2022
8d46608
add table item test code
nkysg Jul 13, 2022
c48e5d2
fix warnings
nkysg Jul 13, 2022
a9dbbae
update move repo
nkysg Jul 20, 2022
5f99371
Merge branch 'master' into update_move
nkysg Jul 20, 2022
34fdbe3
fix fmt
nkysg Jul 20, 2022
ecd9d5f
reset proxima
nkysg Jul 20, 2022
f555439
add proxima genesis_config.json
nkysg Jul 20, 2022
83f1192
branch update_move add docker build
nkysg Jul 20, 2022
5c0af6a
add table_info storage
nkysg Jul 21, 2022
b56d0ff
update starcoin-framework repo
nkysg Jul 21, 2022
eba3f68
fix clippy warnings
nkysg Jul 21, 2022
21d6667
reset proxima genesis
nkysg Jul 21, 2022
bdac32f
update docker build
nkysg Jul 21, 2022
35e2e72
Merge branch 'master' into update_move
nkysg Jul 26, 2022
7dfe6df
update starcoin_framework
nkysg Aug 1, 2022
91d9073
gen new stdlib, reset proxima genesis
nkysg Aug 1, 2022
141532d
gen new stdlib, reset proxima genesis
nkysg Aug 1, 2022
9c16d31
gen new stdlib, reset proxima genesis
nkysg Aug 1, 2022
e8e00f0
gen new stdlib, reset proxima genesis
nkysg Aug 1, 2022
9c05929
add TableItemProof
nkysg Jul 29, 2022
62a9085
add TableItemProof
nkysg Aug 3, 2022
ee94b3b
fmt Cargo.toml
nkysg Aug 5, 2022
ff67c97
add TableItemProof unit_test
nkysg Aug 8, 2022
4de7967
change StateKeyView serde Field attributes
nkysg Aug 9, 2022
084a3e1
fix pre_lib
nkysg Aug 12, 2022
6a2d5ac
[Feature]Add string module (#3626)
WGB5445 Aug 16, 2022
dd85be3
add manual dispatch to workflow build and test
nkysg Aug 17, 2022
12f9416
add pr build_test
nkysg Sep 1, 2022
dabeb6f
fix execute script (#3705)
nkysg Sep 2, 2022
fa99f3f
fix mpm package table test (#3715)
nkysg Sep 5, 2022
e4389f2
[dev branch]table extension compatible dry run (#3706)
nkysg Sep 13, 2022
0c095dc
close #3732
LemonHX Sep 14, 2022
60ec947
mpm: remove tmp code
nanne007 Sep 22, 2022
a367145
Merge branch 'master' into dev
nkysg Oct 13, 2022
2708122
[dev]Update docker_build.yml docker/setup-buildx-action to 2, Docker…
jiangying000 Oct 8, 2022
8eba92a
[dev] remove starcoin-x package,update script and config (#3772)
jiangying000 Oct 9, 2022
40acaa0
use BAD_TRANSACTION_FEE_CURRENCY for test
nkysg Oct 13, 2022
c5e39a1
Merge branch 'master' into dev
nkysg Feb 6, 2023
edba7d7
Merge branch 'master' into dev
nkysg Feb 7, 2023
c6fb713
abi support u16, u32, u256
nkysg Feb 10, 2023
bbb514e
abi support u16, u32, u256
nkysg Feb 10, 2023
07ba45d
update rpc schema
nkysg Feb 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
948 changes: 602 additions & 346 deletions Cargo.lock

Large diffs are not rendered by default.

105 changes: 63 additions & 42 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ members = [
"vm/transaction-builder-generator",
"vm/move-coverage",
"vm/resource-viewer",
"vm/starcoin-gas",
"vm/dev",
"vm/gas-algebra-ext",
"vm/move-explain",
"vm/move-package-manager",
"vm/vm-status-translator",
Expand Down Expand Up @@ -178,7 +180,9 @@ default-members = [
"vm/transaction-builder-generator",
"vm/move-coverage",
"vm/resource-viewer",
"vm/starcoin-gas",
"vm/dev",
"vm/gas-algebra-ext",
"vm/move-explain",
"vm/move-package-manager",
"vm/vm-status-translator",
Expand Down Expand Up @@ -215,7 +219,7 @@ debug-assertions = false
codegen-units = 1

[workspace.package]
authors = ["Starcoin Core Dev <dev@starcoin.org>", ]
authors = ["Starcoin Core Dev <dev@starcoin.org>"]
edition = "2021"
homepage = "https://starcoin.org"
license = "Apache-2.0"
Expand Down Expand Up @@ -246,18 +250,18 @@ bitflags = "1.3.2"
bs58 = "0.3.1"
byteorder = "1.3.4"
bytes = "1"
chrono = { version = "0.4.19", default-features = false, features = ["clock", ] }
clap = { version = "3", features = ["derive", ] }
chrono = { version = "0.4.19", default-features = false, features = ["clock"] }
clap = { version = "3", features = ["derive"] }
cli-table = "0.3.2"
coarsetime = "0.1.22"
codespan = { version = "0.8.0", features = ["serialization", ] }
codespan = { version = "0.8.0", features = ["serialization"] }
codespan-reporting = "0.11"
colored = "2.0.0"
criterion = "0.3"
crossbeam-channel = "0.5.6"
cryptonight-rs = { path = "consensus/cryptonight-rs" }
csv = "~1"
ctrlc = { version = "3.2.2", features = ["termination", ] }
ctrlc = { version = "3.2.2", features = ["termination"] }
cucumber = { package = "cucumber_rust", version = "^0.6.0" }
darling = "0.10.2"
dashmap = "~5"
Expand All @@ -280,12 +284,12 @@ futures-retry = "0.6"
futures-timer = "3.0"
futures-util = "~0.3"
git-version = "0.3.5"
governor = { version = "0.4.2", features = ["dashmap", ] }
governor = { version = "0.4.2", features = ["dashmap"] }
heck = "0.3.3"
hex = "0.4"
hmac = "0.12.1"
hyper = { version = "0.14.12", features = ["full", ] }
include_dir = { version = "0.6.2", features = ["search", ] }
hyper = { version = "0.14.12", features = ["full"] }
include_dir = { version = "0.6.2", features = ["search"] }
indicatif = "0.16.2"
ip_network = "0.3.4"
io-lifetimes = "0.7.2"
Expand All @@ -296,8 +300,10 @@ jsonrpc-client-transports = "18"
jsonrpc-core = "18"
jsonrpc-core-client = "18"
jsonrpc-derive = "18"
openrpc-derive = {git = "https://github.com/starcoinorg/openrpc-rs",rev = "42e9fdc00036a24c560c2827e84cf4e078edbd0d",features=["jsonrpc"]}
openrpc-schema = {git = "https://github.com/starcoinorg/openrpc-rs",rev = "42e9fdc00036a24c560c2827e84cf4e078edbd0d"}
openrpc-derive = { git = "https://github.com/starcoinorg/openrpc-rs", rev = "42e9fdc00036a24c560c2827e84cf4e078edbd0d", features = [
"jsonrpc",
] }
openrpc-schema = { git = "https://github.com/starcoinorg/openrpc-rs", rev = "42e9fdc00036a24c560c2827e84cf4e078edbd0d" }

jsonrpc-http-server = "18"
jsonrpc-ipc-server = "18"
Expand All @@ -314,33 +320,36 @@ libsecp256k1 = "0.7.1"
linked-hash-map = "0.5.6"
linked_hash_set = "0.1.3"
log = { version = "0.4.16" }
log4rs = { version = "1.0.0", features = ["background_rotation", "gzip", ] }
log4rs = { version = "1.0.0", features = ["background_rotation", "gzip"] }
lru = "0.7.8"
merkletree = { git = "https://github.com/filecoin-project/merkletree", rev = "3b1d98c43b341aed935152c5c1535c17d1b21d20" }
mirai-annotations = "1.10.1"
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-bytecode-source-map = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-cli = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-compiler = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-core-types = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-coverage = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-disassembler = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-docgen = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-ir-compiler = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-ir-types = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-model = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-package = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-prover = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-prover-test-utils = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-resource-viewer = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-stdlib = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-transactional-test-runner = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-unit-test = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-vm-runtime = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-vm-types = { git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03" }
move-binary-format = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-bytecode-source-map = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-bytecode-verifier = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-cli = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-command-line-common = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-compiler = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-core-types = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-coverage = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-disassembler = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-docgen = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-errmapgen = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-ir-compiler = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-ir-types = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-model = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-package = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-prover = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-prover-test-utils = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-resource-viewer = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-stdlib = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-transactional-test-runner = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-unit-test = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-vm-runtime = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-vm-types = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-table-extension = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }
move-vm-test-utils = { git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c" }

names = { version = "0.14.0", default-features = false }
network-api = { path = "network/api", package = "network-api" }
network-p2p = { path = "network-p2p" }
Expand Down Expand Up @@ -375,7 +384,7 @@ regex = "1.6.0"
ripemd160 = "0.9.1"
rlp = "0.4"
rlp-derive = "0.1"
rocksdb = { default-features = false, features = ["lz4", ], version = "0.18" }
rocksdb = { default-features = false, features = ["lz4"], version = "0.18" }
rpassword = "~5"
rust-argon2 = "0.8"
rust-embed = "6.3.0"
Expand Down Expand Up @@ -425,7 +434,7 @@ starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev
starcoin-decrypt = { path = "commons/decrypt" }
starcoin-dev = { path = "vm/dev" }
starcoin-executor = { path = "executor" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "cf1deda180af40a8b3e26c0c7b548c4c290cd7e7" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "a7eff4fa3e08cecfed09edf3dbf9d216832d7414" }
starcoin-genesis = { path = "genesis" }
starcoin-logger = { path = "commons/logger" }
starcoin-metrics = { path = "commons/metrics" }
Expand All @@ -434,6 +443,8 @@ starcoin-miner-client = { path = "cmd/miner_client" }
starcoin-miner-client-api = { path = "cmd/miner_client/api" }
starcoin-move-compiler = { path = "vm/compiler" }
starcoin-move-explain = { path = "vm/move-explain" }
starcoin-gas-algebra-ext = { path = "vm/gas-algebra-ext" }
starcoin-gas = { path = "vm/starcoin-gas" }
starcoin-natives = { path = "vm/natives" }
starcoin-network = { path = "network" }
starcoin-network-rpc = { path = "network-rpc" }
Expand Down Expand Up @@ -471,24 +482,34 @@ stdlib = { path = "vm/stdlib" }
stest = { path = "commons/stest" }
stest-macro = { path = "commons/stest/stest-macro" }
stream-task = { path = "commons/stream-task" }
syn = { version = "1.0", features = ["full", "extra-traits", "visit", "fold", ] }
syn = { version = "1.0.107", features = [
"full",
"extra-traits",
"visit",
"fold",
] }
sysinfo = "0.25.1"
tempfile = "3.2.0"
test-helper = { path = "test-helper" }
textwrap = "0.14.0"
thiserror = "1.0"
timeout-join-handler = { path = "commons/timeout-join-handler" }
tiny-keccak = { version = "2", features = ["keccak", ] }
tiny-keccak = { version = "2", features = ["keccak"] }
tiny_http = "0.8.2"
tokio = { version = "^1", features = ["full", ] }
tokio-executor = { version = "0.2.0-alpha.6", features = ["blocking", ] }
tokio = { version = "^1", features = ["full"] }
tokio-executor = { version = "0.2.0-alpha.6", features = ["blocking"] }
toml = "0.5.9"
trace-time = "0.1"
tracing = "0.1.34"
transaction-pool = "2.0.3"
uint = "0.9.3"
unsigned-varint = { version = "0.6.0", features = ["futures", "asynchronous_codec", ] }
vm = { package = "move-binary-format", git = "https://github.com/starcoinorg/move", rev = "2b85bf33378a4469e40b10e7bed815bdbefc5d03", features = ["fuzzing", ] }
unsigned-varint = { version = "0.6.0", features = [
"futures",
"asynchronous_codec",
] }
vm = { package = "move-binary-format", git = "https://github.com/starcoinorg/move", rev = "a781b641dd345c3e8f3e83ed080597f6c23a157c", features = [
"fuzzing",
] }
vm-status-translator = { path = "vm/vm-status-translator" }
void = "1.0.2"
walkdir = "2.3.1"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

Starcoin - a smart contract blockchain network that scales by layering

net proxima using move with table extension feature. If you want to use it, you should compile dev branch.

[Report a Bug](https://github.com/starcoinorg/starcoin/issues/new?assignees=&labels=bug&template=01_BUG_REPORT.md&title=bug%3A+")
·
[Request a Feature](https://github.com/starcoinorg/starcoin/issues/new?assignees=&labels=enhancement&template=02_FEATURE_REQUEST.md&title=feat%3A+")
Expand Down
2 changes: 1 addition & 1 deletion abi/decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ hex = { workspace = true }
move-binary-format = { workspace = true }
ordinal = { workspace = true }
schemars = { workspace = true }
serde = { features = [ "derive", "rc",], workspace = true }
serde = { features = ["derive", "rc"], workspace = true }
serde_bytes = { workspace = true }
serde_json = { workspace = true }
starcoin-abi-resolver = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions abi/decoder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ fn value_to_json(origin: AnnotatedMoveValue) -> serde_json::Value {
// try bytes to string, or else to hex string.
AnnotatedMoveValue::Bytes(v) => Value::String(format!("0x{}", hex::encode(v.as_slice()))),
AnnotatedMoveValue::Struct(v) => struct_to_json(v),
AnnotatedMoveValue::U16(v) => Value::Number(v.into()),
AnnotatedMoveValue::U32(v) => Value::Number(v.into()),
AnnotatedMoveValue::U256(v) => Value::String(v.to_string() + "u256"),
}
}
impl From<AnnotatedMoveStruct> for DecodedMoveValue {
Expand Down
41 changes: 29 additions & 12 deletions abi/resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ impl<'a> ABIResolver<'a> {
let functions = m
.exposed_functions
.iter()
.filter(|(_, func)| func.visibility == Visibility::Script) // only script functions
// .filter(|(_, func)| func.visibility == Visibility::Script) // only script functions
.filter(|(_, func)| func.visibility as u8 == Visibility::DEPRECATED_SCRIPT) // only script functions
.map(|(name, func)| self.function_to_abi(&module_id, name.as_ident_str(), func))
.collect::<Result<Vec<_>>>()?;
Ok(ModuleABI::new(m.module_id(), structs, functions))
Expand Down Expand Up @@ -119,6 +120,10 @@ impl<'a> ABIResolver<'a> {
TypeTag::Struct(struct_type) => {
TypeInstantiation::new_struct_instantiation(self.resolve_struct_tag(struct_type)?)
}

TypeTag::U16 => TypeInstantiation::U16,
TypeTag::U32 => TypeInstantiation::U32,
TypeTag::U256 => TypeInstantiation::U256,
})
}

Expand Down Expand Up @@ -163,6 +168,10 @@ impl<'a> ABIResolver<'a> {
Type::MutableReference(ty) => {
TypeInstantiation::Reference(true, Box::new(self.resolve_type(ty)?))
}

Type::U16 => TypeInstantiation::U16,
Type::U32 => TypeInstantiation::U32,
Type::U256 => TypeInstantiation::U256,
})
}

Expand Down Expand Up @@ -351,14 +360,15 @@ fn find_struct_def_in_module(
mod tests {
use crate::ABIResolver;
use anyhow::Result;
use starcoin_vm_types::access_path::{AccessPath, DataPath};
use starcoin_vm_types::access_path::DataPath;
use starcoin_vm_types::account_address::AccountAddress;
use starcoin_vm_types::account_config::genesis_address;
use starcoin_vm_types::file_format::CompiledModule;
use starcoin_vm_types::identifier::Identifier;
use starcoin_vm_types::language_storage::ModuleId;
use starcoin_vm_types::normalized::Module;
use starcoin_vm_types::parser::parse_struct_tag;
use starcoin_vm_types::state_store::state_key::StateKey;
use starcoin_vm_types::state_view::StateView;
use std::collections::BTreeMap;

Expand All @@ -373,16 +383,23 @@ mod tests {
}
}
impl StateView for InMemoryStateView {
fn get(&self, access_path: &AccessPath) -> Result<Option<Vec<u8>>> {
let module_id = match &access_path.path {
DataPath::Code(name) => ModuleId::new(access_path.address, name.clone()),
_ => anyhow::bail!("no data"),
};
Ok(self.modules.get(&module_id).map(|m| {
let mut data = vec![];
m.serialize(&mut data).unwrap();
data
}))
fn get_state_value(&self, state_key: &StateKey) -> Result<Option<Vec<u8>>> {
match state_key {
StateKey::AccessPath(access_path) => {
let module_id = match &access_path.path {
DataPath::Code(name) => ModuleId::new(access_path.address, name.clone()),
_ => anyhow::bail!("no data"),
};
Ok(self.modules.get(&module_id).map(|m| {
let mut data = vec![];
m.serialize(&mut data).unwrap();
data
}))
}
StateKey::TableItem(_table_item) => {
anyhow::bail!("no need table_item")
}
}
}

fn is_genesis(&self) -> bool {
Expand Down
1 change: 1 addition & 0 deletions abi/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ serde = { workspace = true }
serde_bytes = { workspace = true }
serde_json = { workspace = true }
starcoin-vm-types = { workspace = true }
move-core-types = { workspace = true }

[package]
authors = { workspace = true }
Expand Down
Loading