From 66c6235dba8580c89a1fa8dece451b879f7dab1a Mon Sep 17 00:00:00 2001 From: Ashutosh Varma Date: Thu, 19 Oct 2023 13:12:25 +0530 Subject: [PATCH] feat: apply code suggestions --- tests/integration/src/setup.rs | 14 +++++++++----- tests/integration/src/unified_accounts.rs | 6 ++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/integration/src/setup.rs b/tests/integration/src/setup.rs index 3c09af82fa..7d59f3ac04 100644 --- a/tests/integration/src/setup.rs +++ b/tests/integration/src/setup.rs @@ -55,7 +55,7 @@ mod shibuya { ::AddressMapping::into_account_id(address) } - /// Deploy an EVM contract with code. + /// Deploy an EVM contract with code via ALICE as origin. pub fn deploy_evm_contract(code: &str) -> H160 { assert_ok!(EVM::create2( RuntimeOrigin::root(), @@ -97,16 +97,20 @@ mod shibuya { address } - /// Call a wasm smart contract method with ALICE as origin - pub fn call_wasm_contract_method(contract_id: AccountId, data: Vec) -> V { + /// Call a wasm smart contract method + pub fn call_wasm_contract_method( + origin: AccountId, + contract_id: AccountId, + data: Vec, + ) -> V { let (value, _, _) = astar_test_utils::call_wasm_contract_method::( - ALICE, + origin, contract_id, 0, Weight::from_parts(10_000_000_000, 1024 * 1024), None, data, - true, + false, ); value } diff --git a/tests/integration/src/unified_accounts.rs b/tests/integration/src/unified_accounts.rs index de89dbdc85..ded4e36805 100644 --- a/tests/integration/src/unified_accounts.rs +++ b/tests/integration/src/unified_accounts.rs @@ -56,6 +56,7 @@ fn unified_accounts_chain_extension_works() { // mapped h160 address should None assert_eq!( call_wasm_contract_method::>( + ALICE, contract_id.clone(), [GET_H160.to_vec(), ALICE.encode()].concat() ), @@ -64,6 +65,7 @@ fn unified_accounts_chain_extension_works() { // default h160 address should match assert_eq!( call_wasm_contract_method::( + ALICE, contract_id.clone(), [GET_H160_OR_DEFAULT.to_vec(), ALICE.encode()].concat() ), @@ -72,6 +74,7 @@ fn unified_accounts_chain_extension_works() { // mapped native address should be None assert_eq!( call_wasm_contract_method::>( + ALICE, contract_id.clone(), [GET_NATIVE.to_vec(), alith().encode()].concat() ), @@ -80,6 +83,7 @@ fn unified_accounts_chain_extension_works() { // default native address should match assert_eq!( call_wasm_contract_method::( + ALICE, contract_id.clone(), [GET_NATIVE_OR_DEFAULT.to_vec(), alith().encode()].concat() ), @@ -94,6 +98,7 @@ fn unified_accounts_chain_extension_works() { // ALICE mapped h160 address should be alith assert_eq!( call_wasm_contract_method::>( + ALICE, contract_id.clone(), [GET_H160.to_vec(), ALICE.encode()].concat() ), @@ -103,6 +108,7 @@ fn unified_accounts_chain_extension_works() { // alith mapped native address should ALICE assert_eq!( call_wasm_contract_method::>( + ALICE, contract_id.clone(), [GET_NATIVE.to_vec(), alith().encode()].concat() ),