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

LoaderV2 integration #139

Merged
merged 36 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7026441
wip: apply loader v2, need to fix move to json error
sh-cha Oct 4, 2024
beec7b4
copy type conversion functions from runtime loader & handle json pars…
sh-cha Oct 7, 2024
72e80a9
bump aptos core loader v2 version
sh-cha Oct 7, 2024
95c50af
introduce InitiaModuleStorage using LRU module cache
sh-cha Oct 10, 2024
2846e87
Merge branch 'main' into feat/vm-loaderv2
sh-cha Oct 10, 2024
f508c7d
introduce InitiaCodeStorage to connect InitiaModuleStorage
sh-cha Oct 10, 2024
4c2b6ae
manage module cache as a single unit within the Initia VM
sh-cha Oct 11, 2024
b883063
manage script cache as a single unit within the Initia VM
sh-cha Oct 11, 2024
f61941c
fmt and clippy
sh-cha Oct 11, 2024
574329b
compiled module & script interface change
sh-cha Oct 14, 2024
4db894c
use custom move (#140)
beer-1 Oct 14, 2024
19859b3
update rust version
beer-1 Oct 14, 2024
efef800
clone runtime_environment on every call
beer-1 Oct 14, 2024
5bda0a3
introduce lock on cache (#141)
beer-1 Oct 15, 2024
c131df7
use aptor-core move & flush type_cache every vm call
sh-cha Oct 15, 2024
af0ca61
not cloning environment with flushed ty_cache
sh-cha Oct 15, 2024
2e77522
fix coderabbit audit
beer-1 Oct 15, 2024
c6abc73
feat: deps code upgrade policy check (#144)
sh-cha Oct 21, 2024
9e49a92
apply recent aptos update making struct index map to arc
sh-cha Oct 24, 2024
9fa398c
calculate cache size using real heap size
sh-cha Oct 28, 2024
bee348d
fmt clippy
sh-cha Oct 28, 2024
9e78fde
add storage & code conversion test
sh-cha Oct 28, 2024
ee4f7e8
fix script access specifier
sh-cha Oct 29, 2024
e2cf136
add code scale test code to be used in e2e test & debug code to ident…
sh-cha Oct 29, 2024
dbe9785
add panic handling when fetching size
sh-cha Oct 29, 2024
34c4c8d
Merge branch 'main' into feat/vm-loaderv2
beer-1 Oct 29, 2024
bf1b2c6
apply merged version
sh-cha Oct 30, 2024
4e72f5f
Feat/refactor native code (#154)
sh-cha Oct 30, 2024
73e625f
nit error message change
sh-cha Oct 30, 2024
7a51d5d
cleanup module cache code
sh-cha Oct 30, 2024
9ea7d92
nit error message
sh-cha Oct 30, 2024
f17410f
delete type conversion funcs from sessionExt & use them from session …
sh-cha Oct 30, 2024
1ab2947
use 1 as cache weight for all cache items
beer-1 Oct 30, 2024
4ff217c
Merge branch 'main' of https://github.com/initia-labs/movevm into fea…
beer-1 Oct 30, 2024
5060f4c
minor lint fix
beer-1 Oct 30, 2024
7c1ede3
feat: use constant cache weight for all modules & scripts (#156)
beer-1 Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[env]

RUST_BIGDECIMAL_FMT_EXPONENTIAL_UPPER_THRESHOLD="100"
RUST_BIGDECIMAL_FMT_EXPONENTIAL_LOWER_THRESHOLD="100"
RUST_BIGDECIMAL_FMT_EXPONENTIAL_LOWER_THRESHOLD="100"
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.77.1
toolchain: 1.80.1
override: true
components: rustfmt, clippy
- uses: actions/setup-go@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install latest rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.77.1
toolchain: 1.80.1
- name: Build Rust
run: make build-rust
- uses: actions/setup-go@v4
Expand Down
106 changes: 55 additions & 51 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ license = "BUSL-1.1"
license-file = "LICENSE"
homepage = "https://initia.xyz"
repository = "https://github.com/initia-labs/movevm"
rust-version = "1.77.1"
rust-version = "1.80.1"
sh-cha marked this conversation as resolved.
Show resolved Hide resolved

[workspace.dependencies]
# Internal crate dependencies.
Expand All @@ -65,9 +65,11 @@ initia-move-resource-viewer = { path = "crates/resource-viewer" }

# External crate dependencies.
# Please do not add any test features here: they should be declared by the individual crate.
anyhow = "1.0.41"
bcs = "0.1.5"
ambassador = "0.4.1"
anyhow = "1.0.71"
bcs = { git = "https://github.com/aptos-labs/bcs.git", rev = "d31fab9d81748e2594be5cd5cdf845786a30562d" }
sh-cha marked this conversation as resolved.
Show resolved Hide resolved
better_any = "0.1.1"
claims = "0.7"
clru = "^0.6.2"
cbindgen = "0.26.0"
clap = { version = "4.3.9", features = ["derive", "env", "suggestions"] }
Expand All @@ -76,7 +78,7 @@ dialoguer = "0.10.2"
ed25519-consensus = { version = "2.0.1", features = ["serde"] }
errno = "0.3.0"
hex = { version = "0.4.3", default-features = false }
itertools = "0.10.3"
itertools = "0.13"
libsecp256k1 = { version = "0.7.1" }
log = { version = "0.4.17", features = [
"max_level_debug",
Expand All @@ -95,68 +97,70 @@ serde-generate = { git = "https://github.com/aptos-labs/serde-reflection", rev =
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "73b6bbf748334b71ff6d7d09d06a29e3062ca075" }
sha2 = "0.10.8"
sha3 = "0.10.6"
smallvec = "1.6.1"
smallvec = "1.8.0"
smallbitvec = "2.5.1"
tempfile = "3.2.0"
tempfile = "3.3.0"
serial_test = "1.0.0"
thiserror = "1.0.34"
thiserror = "1.0.37"
tsu = "1.0.1"
bytes = "1.4.0"
parking_lot = "0.12.1"
base64 = "0.21.7"
bigdecimal = ">=0.4.5"
primitive-types = { version = "0.10" }
bech32 = "0.11"
triomphe = "0.1.9"
tiny-keccak = { version = "2.0.2", features = ["keccak", "sha3"] }
get-size = { version = "0.1.4", features = ["derive"]}

# Note: the BEGIN and END comments below are required for external tooling. Do not remove.
# BEGIN MOVE DEPENDENCIES

move-binary-format = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-bytecode-verifier = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-bytecode-utils = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-cli = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-command-line-common = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-compiler = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-coverage = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-core-types = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-docgen = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-model = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-package = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-prover = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-prover-boogie-backend = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-prover-bytecode-pipeline = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-resource-viewer = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-stackless-bytecode = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-stdlib = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-symbol-pool = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-unit-test = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-vm-runtime = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-vm-test-utils = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-vm-types = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "85966af7ddcf971f3f04f4f409c3e67c9d9b11cb" }
move-binary-format = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-bytecode-verifier = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-bytecode-utils = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-cli = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-command-line-common = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-compiler = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-coverage = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-core-types = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-docgen = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-model = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-package = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-prover = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-prover-boogie-backend = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-prover-bytecode-pipeline = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-resource-viewer = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-stackless-bytecode = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-stdlib = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-symbol-pool = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-unit-test = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-vm-runtime = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-vm-test-utils = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }
move-vm-types = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "7131086965eb19c1c7f35b2003d2a5637691f108" }

# END MOVE DEPENDENCIES

# FOR LOCAL DEVELOPMENNT
# move-binary-format = { path = "../aptos-core/third_party/move/move-binary-format" }
# move-bytecode-verifier = { path = "../aptos-core/third_party/move/move-bytecode-verifier" }
# move-bytecode-utils = { path = "../aptos-core/third_party/move/tools/move-bytecode-utils" }
# move-cli = { path = "../aptos-core/third_party/move/tools/move-cli" }
# move-command-line-common = { path = "../aptos-core/third_party/move/move-command-line-common" }
# move-compiler = { path = "../aptos-core/third_party/move/move-compiler" }
# move-coverage ={ path = "../aptos-core/third_party/move/tools/move-coverage" }
# move-core-types = { path = "../aptos-core/third_party/move/move-core/types" }
# move-docgen = { path = "../aptos-core/third_party/move/move-prover/move-docgen" }
# move-model = { path = "../aptos-core/third_party/move/move-model" }
# move-package = { path = "../aptos-core/third_party/move/tools/move-package" }
# move-prover = { path = "../aptos-core/third_party/move/move-prover" }
# move-prover-boogie-backend = { path = "../aptos-core/third_party/move/move-prover/boogie-backend" }
# move-prover-bytecode-pipeline = { path = "../aptos-core/third_party/move/move-prover/bytecode-pipeline" }
# move-resource-viewer = { path = "../aptos-core/third_party/move/tools/move-resource-viewer" }
# move-stackless-bytecode = { path = "../aptos-core/third_party/move/move-model/bytecode" }
# move-stdlib = { path = "../aptos-core/third_party/move/move-stdlib" }
# move-symbol-pool = { path = "../aptos-core/third_party/move/move-symbol-pool" }
# move-unit-test = { path = "../aptos-core/third_party/move/tools/move-unit-test" }
# move-vm-runtime = { path = "../aptos-core/third_party/move/move-vm/runtime" }
# move-vm-test-utils = { path = "../aptos-core/third_party/move/move-vm/test-utils" }
# move-vm-types = { path = "../aptos-core/third_party/move/move-vm/types" }
# move-binary-format = { path = "../move/move-binary-format" }
# move-bytecode-verifier = { path = "../move/move-bytecode-verifier" }
# move-bytecode-utils = { path = "../move/tools/move-bytecode-utils" }
# move-cli = { path = "../move/tools/move-cli" }
# move-command-line-common = { path = "../move/move-command-line-common" }
# move-compiler = { path = "../move/move-compiler" }
# move-coverage ={ path = "../move/tools/move-coverage" }
# move-core-types = { path = "../move/move-core/types" }
# move-docgen = { path = "../move/move-prover/move-docgen" }
# move-model = { path = "../move/move-model" }
# move-package = { path = "../move/tools/move-package" }
# move-prover = { path = "../move/move-prover" }
# move-prover-boogie-backend = { path = "../move/move-prover/boogie-backend" }
# move-prover-bytecode-pipeline = { path = "../move/move-prover/bytecode-pipeline" }
# move-resource-viewer = { path = "../move/tools/move-resource-viewer" }
# move-stackless-bytecode = { path = "../move/move-model/bytecode" }
# move-stdlib = { path = "../move/move-stdlib" }
# move-symbol-pool = { path = "../move/move-symbol-pool" }
# move-unit-test = { path = "../move/tools/move-unit-test" }
# move-vm-runtime = { path = "../move/move-vm/runtime" }
# move-vm-test-utils = { path = "../move/move-vm/test-utils" }
# move-vm-types = { path = "../move/move-vm/types" }
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test-safety:
# Use package list mode to include all subdirectores. The -count=1 turns off caching.
GODEBUG=cgocheck=2 go test -race -v -count=1 -parallel=1 ./...

test-rust: test-compiler test-lib test-e2e test-movevm test-json
test-rust: test-compiler test-lib test-e2e test-movevm test-json test-storage

test-compiler:
cargo test -p initia-move-compiler
Expand All @@ -67,6 +67,9 @@ test-json:
test-lib:
cargo test -p initia-move-vm

test-storage:
cargo test -p initia-move-storage

test-e2e:
cargo test -p e2e-move-tests --features testing

Expand Down
Binary file modified api/libcompiler.dylib
100644 → 100755
Binary file not shown.
Binary file modified api/libmovevm.dylib
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion builders/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN set -eux \

RUN wget "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init" \
&& chmod +x rustup-init \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.77.1 \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.80.1 \
&& rm rustup-init \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME

Expand Down
2 changes: 1 addition & 1 deletion builders/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \

RUN wget "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init" \
&& chmod +x rustup-init \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.77.1 \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.80.1 \
&& rm rustup-init \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME \
&& rustup --version \
Expand Down
2 changes: 1 addition & 1 deletion builders/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.77.1-bullseye
FROM rust:1.80.1-bullseye

# Install build dependencies
RUN apt-get update \
Expand Down
11 changes: 6 additions & 5 deletions crates/compiler/src/unit_test_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ impl InitiaUnitTestFactory {
let table_change_set = table_context
.into_change_set()
.map_err(|e| e.finish(Location::Undefined))?;
let write_set = WriteSet::new(changes.clone(), table_change_set).map_err(|e| {
PartialVMError::new(StatusCode::FAILED_TO_SERIALIZE_WRITE_SET_CHANGES)
.with_message(e.to_string())
.finish(Location::Undefined)
})?;
let write_set =
WriteSet::new_with_change_set(changes.clone(), table_change_set).map_err(|e| {
PartialVMError::new(StatusCode::FAILED_TO_SERIALIZE_WRITE_SET_CHANGES)
.with_message(e.to_string())
.finish(Location::Undefined)
})?;

gas_meter.charge_write_set_gas(&write_set)?;

Expand Down
37 changes: 13 additions & 24 deletions crates/e2e-move-tests/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use move_package::BuildConfig;
use crate::test_utils::mock_chain::{MockAPI, MockChain, MockState, MockTableState};
use crate::test_utils::parser::MemberId;
use initia_move_gas::Gas;
use initia_move_storage::{state_view::StateView, state_view_impl::StateViewImpl};
use initia_move_storage::state_view::StateView;
use initia_move_types::access_path::AccessPath;
use initia_move_types::message::{Message, MessageOutput};
use initia_move_types::module::ModuleBundle;
Expand Down Expand Up @@ -69,7 +69,6 @@ impl MoveHarness {

pub fn initialize(&mut self) {
let state = self.chain.create_state();
let resolver = StateViewImpl::new(&state);
let mut table_resolver = MockTableState::new(&state);

let env = Env::new(
Expand All @@ -85,7 +84,7 @@ impl MoveHarness {
.initialize(
&self.api,
&env,
&resolver,
&state,
&mut table_resolver,
self.load_precompiled_stdlib()
.expect("Failed to load precompiles"),
Expand All @@ -109,9 +108,10 @@ impl MoveHarness {
&mut self,
acc: &AccountAddress,
path: &str,
upgrade_policy: u8,
) -> Result<MessageOutput, VMStatus> {
let (module_ids, code) = self.compile_package(path);
let msg = self.create_publish_message(*acc, module_ids, code);
let code = self.compile_package(path);
let msg = self.create_publish_message(*acc, code, upgrade_policy);
self.run_message(msg)
}

Expand Down Expand Up @@ -158,7 +158,6 @@ impl MoveHarness {
view_fn: ViewFunction,
state: &MockState,
) -> Result<ViewOutput, VMStatus> {
let resolver = StateViewImpl::new(state);
let mut table_resolver = MockTableState::new(state);

let gas_limit = Gas::new(100_000_000u64);
Expand All @@ -176,7 +175,7 @@ impl MoveHarness {
&mut gas_meter,
&self.api,
&env,
&resolver,
state,
&mut table_resolver,
&view_fn,
)
Expand All @@ -188,7 +187,7 @@ impl MoveHarness {
vals
}

pub fn compile_package(&mut self, path: &str) -> (Vec<String>, Vec<Vec<u8>>) {
pub fn compile_package(&mut self, path: &str) -> Vec<Vec<u8>> {
let package_path = path_in_crate(path);
let package = BuiltPackage::build(
package_path.clone(),
Expand All @@ -202,29 +201,22 @@ impl MoveHarness {
)
.expect("compile failed");

(
package
.modules()
.map(|v| v.self_id().short_str_lossless())
.collect(),
package.extract_code(),
)
package.extract_code()
}

pub fn create_publish_message(
&mut self,
sender: AccountAddress,
module_ids: Vec<String>,
modules: Vec<Vec<u8>>,
upgrade_policy: u8,
) -> Message {
let ef = MoveHarness::create_entry_function_with_json(
str::parse("0x1::code::publish").unwrap(),
str::parse("0x1::code::publish_v2").unwrap(),
vec![],
vec![
serde_json::to_string(&module_ids).unwrap(),
serde_json::to_string(&modules.iter().map(hex::encode).collect::<Vec<String>>())
.unwrap(),
serde_json::to_string(&(1_u8)).unwrap(), // compatible upgrade policy
serde_json::to_string(&upgrade_policy).unwrap(), // compatible upgrade policy
],
);
Message::execute(vec![sender], ef)
Expand Down Expand Up @@ -321,8 +313,6 @@ impl MoveHarness {
);

let state = self.chain.create_state();

let resolver = StateViewImpl::new(&state);
let mut table_resolver = MockTableState::new(&state);

let gas_limit: initia_move_gas::GasQuantity<initia_move_gas::GasUnit> =
Expand All @@ -332,7 +322,7 @@ impl MoveHarness {
&mut gas_meter,
&self.api,
&env,
&resolver,
&state,
&mut table_resolver,
message,
)
Expand All @@ -351,7 +341,6 @@ impl MoveHarness {
Self::generate_random_hash().try_into().unwrap(),
);

let resolver = StateViewImpl::new(state);
let mut table_resolver = MockTableState::new(state);

let gas_limit = Gas::new(100_000_000u64);
Expand All @@ -360,7 +349,7 @@ impl MoveHarness {
&mut gas_meter,
&self.api,
&env,
&resolver,
state,
&mut table_resolver,
message,
)
Expand Down
Loading
Loading