Skip to content

Commit

Permalink
fix: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyr committed Jun 2, 2022
1 parent 8ef5f09 commit f998684
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 6 additions & 2 deletions crates/benches/benches/benchmarks/smt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use gw_common::{
state::State,
H256,
};
use gw_config::{BackendConfig, GenesisConfig, StoreConfig};
use gw_config::{BackendConfig, BackendSwitchConfig, GenesisConfig, StoreConfig};
use gw_db::{schema::COLUMNS, RocksDB};
use gw_generator::{
account_lock_manage::{always_success::AlwaysSuccess, AccountLockManage},
Expand Down Expand Up @@ -160,7 +160,11 @@ impl BenchExecutionEnvironment {
backend_type: gw_config::BackendType::Sudt,
},
];
BackendManage::from_config(configs).expect("bench backend")
BackendManage::from_config(vec![BackendSwitchConfig {
switch_height: 0,
backends: configs,
}])
.expect("bench backend")
};

let account_lock_manage = {
Expand Down
8 changes: 6 additions & 2 deletions crates/benches/benches/benchmarks/sudt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use criterion::*;
use gw_common::{
builtins::ETH_REGISTRY_ACCOUNT_ID, registry_address::RegistryAddress, state::State, H256,
};
use gw_config::BackendConfig;
use gw_config::{BackendConfig, BackendSwitchConfig};
use gw_generator::{
account_lock_manage::AccountLockManage, backend_manage::BackendManage,
constants::L2TX_MAX_CYCLES, dummy_state::DummyState, error::TransactionError, traits::StateExt,
Expand Down Expand Up @@ -47,7 +47,11 @@ fn build_backend_manage(rollup_config: &RollupConfig) -> BackendManage {
backend_type: gw_config::BackendType::Sudt,
},
];
BackendManage::from_config(configs).expect("default backend")
BackendManage::from_config(vec![BackendSwitchConfig {
switch_height: 0,
backends: configs,
}])
.expect("default backend")
}

struct DummyChainStore;
Expand Down
4 changes: 2 additions & 2 deletions crates/generator/src/backend_manage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ impl BackendManage {
fn compile_backend(&mut self, backend: &Backend) {
self.aot_codes.0.insert(
backend.validator_script_type_hash,
self.aot_compile(backend.generator, 0)
self.aot_compile(&backend.generator, 0)
.expect("Ahead-of-time compile"),
);
self.aot_codes.1.insert(
backend.validator_script_type_hash,
self.aot_compile(backend.generator, 1)
self.aot_compile(&backend.generator, 1)
.expect("Ahead-of-time compile"),
);
}
Expand Down

0 comments on commit f998684

Please sign in to comment.