diff --git a/devtools/ci/integration-test.sh b/devtools/ci/integration-test.sh index 649374a6..36658f88 100644 --- a/devtools/ci/integration-test.sh +++ b/devtools/ci/integration-test.sh @@ -15,7 +15,7 @@ else git clone -b develop https://github.com/nervosnetwork/godwoken.git $GODWOKEN_DIR fi cd $GODWOKEN_DIR -git checkout 1dc4092926291542b76f4f80883f5c6959992510 # https://github.com/nervosnetwork/godwoken/commits/1dc4092 +git checkout 7527776abf53ab069015b66e2569148341425bd8 # https://github.com/nervosnetwork/godwoken/commits/7527776a git submodule update --init --recursive --depth=1 cd $PROJECT_ROOT diff --git a/polyjuice-tests/src/helper.rs b/polyjuice-tests/src/helper.rs index 01bee495..d1e659d5 100644 --- a/polyjuice-tests/src/helper.rs +++ b/polyjuice-tests/src/helper.rs @@ -14,7 +14,8 @@ pub use gw_generator::{ traits::StateExt, Generator, }; -use gw_store::traits::KVStore; +use gw_store::traits::chain_store::ChainStore; +use gw_store::traits::kv_store::KVStoreWrite; pub use gw_store::{chain_view::ChainView, Store}; use gw_traits::CodeStore; use gw_types::offchain::RollupContext; @@ -501,7 +502,7 @@ pub fn deploy( .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), @@ -570,7 +571,7 @@ pub fn simple_storage_get( .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/call_multiple_times.rs b/polyjuice-tests/src/test_cases/call_multiple_times.rs index b099fdaa..7b2939f8 100644 --- a/polyjuice-tests/src/test_cases/call_multiple_times.rs +++ b/polyjuice-tests/src/test_cases/call_multiple_times.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const SS_INIT_CODE: &str = include_str!("./evm-contracts/SimpleStorage.bin"); @@ -140,7 +141,7 @@ fn test_call_multiple_times() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/call_selfdestruct.rs b/polyjuice-tests/src/test_cases/call_selfdestruct.rs index 6fc44eed..ae8bdf77 100644 --- a/polyjuice-tests/src/test_cases/call_selfdestruct.rs +++ b/polyjuice-tests/src/test_cases/call_selfdestruct.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const SD_INIT_CODE: &str = include_str!("./evm-contracts/SelfDestruct.bin"); @@ -133,7 +134,7 @@ fn test_selfdestruct() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), @@ -186,7 +187,7 @@ fn test_selfdestruct() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let result = generator.execute_transaction( &ChainView::new(&db, tip_block_hash), &state, @@ -218,7 +219,7 @@ fn test_selfdestruct() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let result = generator.execute_transaction( &ChainView::new(&db, tip_block_hash), &state, diff --git a/polyjuice-tests/src/test_cases/contract_call_contract.rs b/polyjuice-tests/src/test_cases/contract_call_contract.rs index 0b95be17..13e2f116 100644 --- a/polyjuice-tests/src/test_cases/contract_call_contract.rs +++ b/polyjuice-tests/src/test_cases/contract_call_contract.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const SS_INIT_CODE: &str = include_str!("./evm-contracts/SimpleStorage.bin"); @@ -116,7 +117,7 @@ fn test_contract_call_contract() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), @@ -210,7 +211,7 @@ fn test_contract_call_non_exists_contract() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/contract_create_contract.rs b/polyjuice-tests/src/test_cases/contract_create_contract.rs index 29b6a099..7d65603e 100644 --- a/polyjuice-tests/src/test_cases/contract_create_contract.rs +++ b/polyjuice-tests/src/test_cases/contract_create_contract.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/CreateContract.bin"); @@ -82,7 +83,7 @@ fn test_contract_create_contract() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/create2.rs b/polyjuice-tests/src/test_cases/create2.rs index eef89282..fde00fd6 100644 --- a/polyjuice-tests/src/test_cases/create2.rs +++ b/polyjuice-tests/src/test_cases/create2.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const SS_INIT_CODE: &str = include_str!("./evm-contracts/SimpleStorage.bin"); @@ -90,7 +91,7 @@ fn test_create2() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/delegatecall.rs b/polyjuice-tests/src/test_cases/delegatecall.rs index b284dad6..585fd710 100644 --- a/polyjuice-tests/src/test_cases/delegatecall.rs +++ b/polyjuice-tests/src/test_cases/delegatecall.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const SS_INIT_CODE: &str = include_str!("./evm-contracts/SimpleStorage.bin"); @@ -121,7 +122,7 @@ fn test_delegatecall() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/ecrecover.rs b/polyjuice-tests/src/test_cases/ecrecover.rs index 63e5e061..45e09905 100644 --- a/polyjuice-tests/src/test_cases/ecrecover.rs +++ b/polyjuice-tests/src/test_cases/ecrecover.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/HeadTail.bin"); @@ -83,7 +84,7 @@ fn test_ecrecover() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/erc20.rs b/polyjuice-tests/src/test_cases/erc20.rs index 356fc594..eaf194b2 100644 --- a/polyjuice-tests/src/test_cases/erc20.rs +++ b/polyjuice-tests/src/test_cases/erc20.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/ERC20.bin"); @@ -158,7 +159,7 @@ fn test_erc20() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/eth_to_godwoken_addr.rs b/polyjuice-tests/src/test_cases/eth_to_godwoken_addr.rs index 42d2352d..322a8d1f 100644 --- a/polyjuice-tests/src/test_cases/eth_to_godwoken_addr.rs +++ b/polyjuice-tests/src/test_cases/eth_to_godwoken_addr.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{ bytes::Bytes, core::ScriptHashType, @@ -81,7 +82,7 @@ fn test_eth_to_godwoken_addr() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/fallback_function.rs b/polyjuice-tests/src/test_cases/fallback_function.rs index 517f6713..3e397f16 100644 --- a/polyjuice-tests/src/test_cases/fallback_function.rs +++ b/polyjuice-tests/src/test_cases/fallback_function.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/FallbackFunction.bin"); @@ -88,7 +89,7 @@ fn test_fallback_function() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/get_block_info.rs b/polyjuice-tests/src/test_cases/get_block_info.rs index c680f0f4..a908130a 100644 --- a/polyjuice-tests/src/test_cases/get_block_info.rs +++ b/polyjuice-tests/src/test_cases/get_block_info.rs @@ -9,7 +9,8 @@ use gw_common::state::State; use gw_db::schema::COLUMN_INDEX; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; -use gw_store::traits::KVStore; +use gw_store::traits::chain_store::ChainStore; +use gw_store::traits::kv_store::KVStoreWrite; use gw_types::{ bytes::Bytes, packed::{RawL2Transaction, Uint64}, @@ -138,7 +139,7 @@ fn test_get_block_info() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/get_chain_id.rs b/polyjuice-tests/src/test_cases/get_chain_id.rs index a91905b9..c1a7147a 100644 --- a/polyjuice-tests/src/test_cases/get_chain_id.rs +++ b/polyjuice-tests/src/test_cases/get_chain_id.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/GetChainId.bin"); @@ -92,7 +93,7 @@ fn test_get_chain_id() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/heap_memory.rs b/polyjuice-tests/src/test_cases/heap_memory.rs index 40769613..d021ffa6 100644 --- a/polyjuice-tests/src/test_cases/heap_memory.rs +++ b/polyjuice-tests/src/test_cases/heap_memory.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const MEMORY_INIT_CODE: &str = include_str!("./evm-contracts/Memory.bin"); @@ -106,7 +107,7 @@ fn test_heap_momory() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let err = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/invalid_sudt_erc20_proxy.rs b/polyjuice-tests/src/test_cases/invalid_sudt_erc20_proxy.rs index 7e2f8712..d403f036 100644 --- a/polyjuice-tests/src/test_cases/invalid_sudt_erc20_proxy.rs +++ b/polyjuice-tests/src/test_cases/invalid_sudt_erc20_proxy.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::{error::TransactionError, traits::StateExt}; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INVALID_SUDT_ERC20_PROXY_CODE: &str = @@ -158,7 +159,7 @@ fn test_invalid_sudt_erc20_proxy() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let result = generator.execute_transaction( &ChainView::new(&db, tip_block_hash), &state, diff --git a/polyjuice-tests/src/test_cases/parse_log_event.rs b/polyjuice-tests/src/test_cases/parse_log_event.rs index 1f882af1..6679d5a4 100644 --- a/polyjuice-tests/src/test_cases/parse_log_event.rs +++ b/polyjuice-tests/src/test_cases/parse_log_event.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/LogEvents.bin"); @@ -169,7 +170,7 @@ fn test_parse_log_event() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/recover_account.rs b/polyjuice-tests/src/test_cases/recover_account.rs index 4320ad54..32c2bac7 100644 --- a/polyjuice-tests/src/test_cases/recover_account.rs +++ b/polyjuice-tests/src/test_cases/recover_account.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::{error::TransactionError, traits::StateExt}; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{ bytes::Bytes, core::ScriptHashType, @@ -183,7 +184,7 @@ fn test_recover_account() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let err = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/recursion_contract.rs b/polyjuice-tests/src/test_cases/recursion_contract.rs index a2690cd7..bc2e01f7 100644 --- a/polyjuice-tests/src/test_cases/recursion_contract.rs +++ b/polyjuice-tests/src/test_cases/recursion_contract.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::{error::TransactionError, traits::StateExt}; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const RECURSION_INIT_CODE: &str = include_str!("./evm-contracts/RecursionContract.bin"); @@ -168,7 +169,7 @@ fn test_recursion_contract_call() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let err = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/selfdestruct.rs b/polyjuice-tests/src/test_cases/selfdestruct.rs index 6941fa34..921d14f1 100644 --- a/polyjuice-tests/src/test_cases/selfdestruct.rs +++ b/polyjuice-tests/src/test_cases/selfdestruct.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/SelfDestruct.bin"); @@ -110,7 +111,7 @@ fn test_selfdestruct() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), @@ -153,7 +154,7 @@ fn test_selfdestruct() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let result = generator.execute_transaction( &ChainView::new(&db, tip_block_hash), &state, diff --git a/polyjuice-tests/src/test_cases/simple_storage.rs b/polyjuice-tests/src/test_cases/simple_storage.rs index eeb00e75..241c63f1 100644 --- a/polyjuice-tests/src/test_cases/simple_storage.rs +++ b/polyjuice-tests/src/test_cases/simple_storage.rs @@ -8,6 +8,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const INIT_CODE: &str = include_str!("./evm-contracts/SimpleStorage.bin"); @@ -101,7 +102,7 @@ fn test_simple_storage() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), @@ -132,7 +133,7 @@ fn test_simple_storage() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/simple_transfer.rs b/polyjuice-tests/src/test_cases/simple_transfer.rs index ff6662a2..714e558b 100644 --- a/polyjuice-tests/src/test_cases/simple_transfer.rs +++ b/polyjuice-tests/src/test_cases/simple_transfer.rs @@ -9,6 +9,7 @@ use crate::helper::{ use gw_common::state::State; use gw_generator::traits::StateExt; use gw_store::chain_view::ChainView; +use gw_store::traits::chain_store::ChainStore; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; const SS_INIT_CODE: &str = include_str!("./evm-contracts/SimpleStorage.bin"); @@ -319,7 +320,7 @@ fn test_simple_transfer() { .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let run_result = generator .execute_transaction( &ChainView::new(&db, tip_block_hash), diff --git a/polyjuice-tests/src/test_cases/sudt_erc20_proxy.rs b/polyjuice-tests/src/test_cases/sudt_erc20_proxy.rs index 5eb31070..c46c3d71 100644 --- a/polyjuice-tests/src/test_cases/sudt_erc20_proxy.rs +++ b/polyjuice-tests/src/test_cases/sudt_erc20_proxy.rs @@ -8,6 +8,7 @@ use crate::helper::{ }; use gw_common::state::State; use gw_generator::{dummy_state::DummyState, error::TransactionError, traits::StateExt, Generator}; +use gw_store::traits::chain_store::ChainStore; use gw_store::{chain_view::ChainView, Store}; use gw_types::{bytes::Bytes, packed::RawL2Transaction, prelude::*}; @@ -359,7 +360,7 @@ fn test_sudt_erc20_proxy_inner( .args(Bytes::from(args).pack()) .build(); let db = store.begin_transaction(); - let tip_block_hash = store.get_tip_block_hash().unwrap(); + let tip_block_hash = db.get_tip_block_hash().unwrap(); let err = generator .execute_transaction( &ChainView::new(&db, tip_block_hash),