Skip to content

Commit ea9950f

Browse files
authored
fund pallet-revive account (#322)
* fund pallet-revive account Signed-off-by: Alexandru Gheorghe <[email protected]> * fixup storage translation tests Signed-off-by: Alexandru Gheorghe <[email protected]> * use asimilate storage instead of manually funding Signed-off-by: Alexandru Gheorghe <[email protected]> --------- Signed-off-by: Alexandru Gheorghe <[email protected]>
1 parent ca95f6e commit ea9950f

File tree

2 files changed

+6
-5
lines changed
  • crates

2 files changed

+6
-5
lines changed

crates/revive-env/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![allow(clippy::disallowed_macros)]
88
use polkadot_sdk::{
99
frame_system, pallet_balances,
10-
pallet_revive::AddressMapper,
10+
pallet_revive::{self, AddressMapper},
1111
polkadot_runtime_common::BuildStorage,
1212
sp_core::H160,
1313
sp_io,
@@ -42,16 +42,18 @@ impl ExtBuilder {
4242
pub fn build(self) -> sp_io::TestExternalities {
4343
sp_tracing::try_init_simple();
4444
let mut t = frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap();
45+
4546
pallet_balances::GenesisConfig::<Runtime> {
4647
balances: self.balance_genesis_config,
4748
dev_accounts: None,
4849
}
4950
.assimilate_storage(&mut t)
5051
.unwrap();
52+
53+
pallet_revive::GenesisConfig::<Runtime>::default().assimilate_storage(&mut t).unwrap();
5154
let mut ext = sp_io::TestExternalities::new(t);
5255
ext.register_extension(KeystoreExt::new(MemoryKeystore::new()));
5356
ext.execute_with(|| System::set_block_number(0));
54-
5557
ext
5658
}
5759
}

crates/revive-strategy/src/cheatcodes/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,13 +480,12 @@ impl foundry_cheatcodes::CheatcodeInspectorStrategyExt for PvmCheatcodeInspector
480480
));
481481
let evm_value = sp_core::U256::from_little_endian(&input.value().as_le_bytes());
482482

483-
let (gas_limit, _storage_deposit_limit) =
483+
let (gas_limit, storage_deposit_limit) =
484484
<<Runtime as Config>::EthGasEncoder as GasEncoder<BalanceOf<Runtime>>>::decode(
485485
gas_limit,
486486
)
487487
.expect("gas limit is valid");
488-
// storage deposit broken on polkadot-sdk/master
489-
let storage_deposit_limit = DepositLimit::UnsafeOnlyForDryRun;
488+
let storage_deposit_limit = DepositLimit::Balance(storage_deposit_limit);
490489
let code = Code::Upload(contract.resolc_bytecode.as_bytes().unwrap().to_vec());
491490
let data = constructor_args.to_vec();
492491
let salt = match input.scheme() {

0 commit comments

Comments
 (0)