From d77ee1e0d42b5053f81d587e4234e1a4310df800 Mon Sep 17 00:00:00 2001 From: Cyrill Leutwiler Date: Fri, 6 Sep 2024 13:50:01 +0200 Subject: [PATCH] runner: endow test accounts on genesis Signed-off-by: Cyrill Leutwiler --- crates/differential/genesis.json | 12 +++++++++++- crates/differential/src/lib.rs | 5 ++--- crates/integration/contracts/Value.sol | 1 + crates/runner/src/specs.rs | 6 +++++- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/crates/differential/genesis.json b/crates/differential/genesis.json index 6d61c4e..3617aa3 100644 --- a/crates/differential/genesis.json +++ b/crates/differential/genesis.json @@ -26,5 +26,15 @@ "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "timestamp": "0x00", - "alloc": {} + "alloc": { + "0101010101010101010101010101010101010101": { + "balance": "1000000000" + }, + "0202020202020202020202020202020202020202": { + "balance": "1000000000" + }, + "0303030303030303030303030303030303030303": { + "balance": "1000000000" + } + } } \ No newline at end of file diff --git a/crates/differential/src/lib.rs b/crates/differential/src/lib.rs index 757713f..332a86b 100644 --- a/crates/differential/src/lib.rs +++ b/crates/differential/src/lib.rs @@ -100,10 +100,9 @@ pub struct EvmOutput { impl EvmOutput { /// Return if there was no error found. /// - /// Panics if the gas used is zero as this indicates nothing was run, i.e. - /// there was no receiving account but still no error is reported. + /// Panics if the gas used is zero as this indicates nothing was run. pub fn run_success(&self) -> bool { - assert_ne!(self.gas_used, U256::ZERO, "nothing was executed"); + assert_ne!(self.gas_used, U256::ZERO, "nothing was executed: {self:?}"); self.error.is_none() } } diff --git a/crates/integration/contracts/Value.sol b/crates/integration/contracts/Value.sol index 031463f..11f2ceb 100644 --- a/crates/integration/contracts/Value.sol +++ b/crates/integration/contracts/Value.sol @@ -19,6 +19,7 @@ pragma solidity ^0.8; "dest": { "Instantiated": 0 }, + "value": 123, "data": "3fa4f245" } } diff --git a/crates/runner/src/specs.rs b/crates/runner/src/specs.rs index e2941b7..6099a7a 100644 --- a/crates/runner/src/specs.rs +++ b/crates/runner/src/specs.rs @@ -179,7 +179,11 @@ impl Default for Specs { fn default() -> Self { Self { differential: false, - balances: vec![(ALICE, 1_000_000_000)], + balances: vec![ + (ALICE, 1_000_000_000), + (BOB, 1_000_000_000), + (CHARLIE, 1_000_000_000), + ], actions: Default::default(), } }