diff --git a/scripts/nextest.sh b/scripts/nextest.sh index 9e1b7fb78a..cd737c5db0 100755 --- a/scripts/nextest.sh +++ b/scripts/nextest.sh @@ -28,6 +28,7 @@ cargo nextest run \ -p starcoin-genesis \ -p starcoin-node \ -p starcoin-config \ +-p starcoin-txpool \ --retries 2 --build-jobs 8 --test-threads 12 --no-fail-fast --failure-output immediate-final diff --git a/vm/types/src/proptest_types.rs b/vm/types/src/proptest_types.rs index f155e5d284..70ba4aca73 100644 --- a/vm/types/src/proptest_types.rs +++ b/vm/types/src/proptest_types.rs @@ -29,6 +29,7 @@ use starcoin_crypto::{ed25519, HashValue, SigningKey}; use starcoin_time_service::{MockTimeService, TimeService}; use std::ops::Deref; use std::sync::Arc; +use vm::file_format_common::VERSION_MAX; use vm::CompiledModule; /// Wrapper for `proptest`'s [`Index`][proptest::sample::Index] that allows `AsRef` to work. @@ -483,7 +484,7 @@ impl Package { (compiled_module_strategy, script_strategy).prop_map(|(compile_module, script)| { let mut vec_bytes: Vec = vec![]; compile_module - .serialize(&mut vec_bytes) + .serialize_for_version(Some(VERSION_MAX), &mut vec_bytes) .expect("compile module serialize must success"); let first_module = Module::new(vec_bytes); let module_vec = vec![first_module]; diff --git a/vm/types/src/transaction/package.rs b/vm/types/src/transaction/package.rs index 821d7610ef..52eac11b3e 100644 --- a/vm/types/src/transaction/package.rs +++ b/vm/types/src/transaction/package.rs @@ -12,7 +12,9 @@ use bcs_ext::Sample; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use starcoin_crypto::hash::{CryptoHash, CryptoHasher}; +use vm::deserializer::DeserializerConfig; use vm::errors::Location; +use vm::file_format_common::{IDENTIFIER_SIZE_MAX, VERSION_MAX}; #[derive( Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize, CryptoHasher, CryptoHash, JsonSchema, @@ -57,7 +59,8 @@ impl Package { } fn parse_module_address(module: &Module) -> Result { - let compiled_module = CompiledModule::deserialize(module.code()) + let config = DeserializerConfig::new(VERSION_MAX, IDENTIFIER_SIZE_MAX); + let compiled_module = CompiledModule::deserialize_with_config(module.code(), &config) .map_err(|e| e.finish(Location::Undefined).into_vm_status())?; Ok(*compiled_module.address()) }