From 3e9682862832b346a40f209bb51438a8ba0cb621 Mon Sep 17 00:00:00 2001 From: keroro Date: Mon, 7 Nov 2022 00:26:22 +0800 Subject: [PATCH] chore: adjust tests and tolls to v2 --- crates/benches/benches/benchmarks/smt.rs | 1 + crates/benches/benches/benchmarks/sudt.rs | 1 + crates/generator/src/utils.rs | 23 ++++--- crates/tests/src/testing_tool/chain.rs | 8 ++- crates/tests/src/tests/export_import_block.rs | 6 +- crates/tests/src/tests/mem_block_repackage.rs | 2 + .../restore_mem_pool_pending_withdrawal.rs | 26 +++++++- .../src/tests/unlock_withdrawal_to_owner.rs | 64 ++++++++++++------- crates/tools/src/deposit_ckb.rs | 5 +- crates/tools/src/main.rs | 12 ++-- crates/tools/src/stat/mod.rs | 5 +- crates/tools/src/withdraw.rs | 6 +- 12 files changed, 110 insertions(+), 49 deletions(-) diff --git a/crates/benches/benches/benchmarks/smt.rs b/crates/benches/benches/benchmarks/smt.rs index d55e54c48..9dd066c98 100644 --- a/crates/benches/benches/benchmarks/smt.rs +++ b/crates/benches/benches/benchmarks/smt.rs @@ -146,6 +146,7 @@ impl BenchExecutionEnvironment { let rollup_context = RollupContext { rollup_config: genesis_config.rollup_config.clone().into(), rollup_script_hash: ROLLUP_TYPE_HASH.into(), + ..Default::default() }; let backend_manage = { diff --git a/crates/benches/benches/benchmarks/sudt.rs b/crates/benches/benches/benchmarks/sudt.rs index 2ca6a0a66..4cbe8fae2 100644 --- a/crates/benches/benches/benchmarks/sudt.rs +++ b/crates/benches/benches/benchmarks/sudt.rs @@ -104,6 +104,7 @@ fn run_contract_get_result( let rollup_ctx = RollupContext { rollup_config: rollup_config.clone(), rollup_script_hash: [42u8; 32].into(), + ..Default::default() }; let generator = Generator::new( backend_manage, diff --git a/crates/generator/src/utils.rs b/crates/generator/src/utils.rs index fe6bf690a..e943eb0e2 100644 --- a/crates/generator/src/utils.rs +++ b/crates/generator/src/utils.rs @@ -3,6 +3,7 @@ use std::convert::TryInto; use gw_common::{builtins::CKB_SUDT_ACCOUNT_ID, state::State, H256}; use gw_config::BackendType; use gw_traits::CodeStore; +use gw_types::core::Timepoint; use gw_types::{ bytes::Bytes, core::{AllowedContractType, ScriptHashType}, @@ -43,7 +44,7 @@ pub fn build_withdrawal_cell_output( rollup_context: &RollupContext, req: &WithdrawalRequestExtra, block_hash: &H256, - block_number: u64, + block_timepoint: &Timepoint, opt_asset_script: Option