Skip to content

Commit

Permalink
fix e2e compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Nov 18, 2024
1 parent ee15be0 commit 290929f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 39 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions vm/e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ move-table-extension = { workspace = true }
starcoin-statedb = { workspace = true }
starcoin-state-tree = { workspace = true }
move-vm-runtime = { workspace = true }
starcoin-gas-schedule = { workspace = true }
starcoin-vm-runtime-types = { workspace = true }

#aptos-keygen = { path = "../../crates/aptos-keygen" }
#aptos-proptest-helpers = { path = "../../crates/aptos-proptest-helpers" }
Expand Down
10 changes: 0 additions & 10 deletions vm/e2e-tests/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,21 +654,11 @@ impl AccountData {
self.sequence_number
}

/// Returns the unique key for this sent events stream.
pub fn sent_events_key(&self) -> &[u8] {
self.coin_store.withdraw_events.key().to_bytes().as_slice()
}

/// Returns the initial sent events count.
pub fn sent_events_count(&self) -> u64 {
self.coin_store.withdraw_events.count()
}

/// Returns the unique key for this received events stream.
pub fn received_events_key(&self) -> &[u8] {
self.coin_store.deposit_events.key().to_bytes().as_slice()
}

/// Returns the initial received events count.
pub fn received_events_count(&self) -> u64 {
self.coin_store.deposit_events.count()
Expand Down
61 changes: 32 additions & 29 deletions vm/e2e-tests/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use crate::account::{Account, AccountData};
use crate::golden_outputs::GoldenOutputs;
use move_core_types::vm_status::KeptVMStatus;
use move_table_extension::NativeTableContext;
use num_cpus;
use serde::Serialize;
use starcoin_config::ChainNetwork;
Expand All @@ -30,7 +29,6 @@ use starcoin_vm_types::{
move_resource::MoveResource,
on_chain_config::{OnChainConfig, VMConfig, Version},
state_store::state_key::StateKey,
transaction::authenticator::AuthenticationKey,
transaction::{SignedUserTransaction, Transaction, TransactionOutput, TransactionStatus},
vm_status::VMStatus,
write_set::WriteSet,
Expand All @@ -39,12 +37,15 @@ use starcoin_vm_types::{
use crate::data_store::FakeDataStore;
use move_vm_runtime::module_traversal::{TraversalContext, TraversalStorage};
use starcoin_statedb::ChainStateWriter;
use starcoin_vm_runtime_types::storage::change_set_configs::ChangeSetConfigs;
use starcoin_vm_types::errors::PartialVMError;
use starcoin_vm_types::on_chain_config::{Features, TimedFeaturesBuilder};
use starcoin_vm_types::state_store::TStateView;
use std::fs::OpenOptions;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::{env, fs};
use starcoin_gas_schedule::LATEST_GAS_FEATURE_VERSION;
use test_helper::Genesis;

static RNG_SEED: [u8; 32] = [9u8; 32];
Expand Down Expand Up @@ -560,22 +561,22 @@ impl FakeExecutor {
)
});

let (change_set, mut extensions) = session
.into_inner()
.finish_with_extensions()
.expect("Failed to generate txn effects");
let table_context: NativeTableContext = extensions.remove();
let table_change_set = table_context
.into_change_set()
.map_err(|e| e.finish(Location::Undefined))?;
let change_set_config =
ChangeSetConfigs::unlimited_at_gas_feature_version(LATEST_GAS_FEATURE_VERSION);

let (change_set, module_write_set) = session
.finish(&change_set_config)
.map_err(|e| e.into_vm_status())?;
// Ignore new table infos.
// No table infos should be produced in readonly function.
let (_table_infos, write_set, _events) = SessionOutput {
change_set,
table_change_set,
}
.into_change_set(&mut ())?;
let (write_set, _events) = change_set
.try_combine_into_storage_change_set(module_write_set)
.map_err(|e| {
PartialVMError::from(e)
.finish(Location::Undefined)
.into_vm_status()
})?
.into_inner();
// let (write_set, _events) = session_out
// .into_change_set(&mut ())
// .expect("Failed to generate writeset")
Expand Down Expand Up @@ -626,20 +627,22 @@ impl FakeExecutor {
)
.map_err(|e| e.into_vm_status())?;

let (change_set, mut extensions) = session
.into_inner()
.finish_with_extensions()
.expect("Failed to generate txn effects");

let table_context: NativeTableContext = extensions.remove();
let table_change_set = table_context
.into_change_set()
.map_err(|e| e.finish(Location::Undefined))?;
let (_table_infos, write_set, _events) = SessionOutput {
change_set,
table_change_set,
}
.into_change_set(&mut ())?;
let change_set_config =
ChangeSetConfigs::unlimited_at_gas_feature_version(LATEST_GAS_FEATURE_VERSION);

let (change_set, module_write_set) = session
.finish(&change_set_config)
.map_err(|e| e.into_vm_status())?;
// Ignore new table infos.
// No table infos should be produced in readonly function.
let (write_set, _events) = change_set
.try_combine_into_storage_change_set(module_write_set)
.map_err(|e| {
PartialVMError::from(e)
.finish(Location::Undefined)
.into_vm_status()
})?
.into_inner();

// let (writeset, _events) = session_out
// .into_change_set(&mut ())
Expand Down

0 comments on commit 290929f

Please sign in to comment.