Skip to content

Commit

Permalink
fund accounts in blockwise spam test
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroXbrock committed Jan 14, 2025
1 parent 439a595 commit 68cccb8
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion crates/core/src/test_scenario.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,10 @@ pub mod tests {
};
use crate::generator::{types::PlanType, util::test::spawn_anvil, RandSeed};
use crate::generator::{Generator, PlanConfig};
use crate::spammer::util::test::get_test_signers;
use crate::spammer::util::test::{fund_account, get_test_signers};
use crate::test_scenario::TestScenario;
use crate::Result;
use alloy::consensus::constants::ETH_TO_WEI;
use alloy::hex::ToHexExt;
use alloy::network::{Ethereum, EthereumWallet, TransactionBuilder};
use alloy::node_bindings::AnvilInstance;
Expand Down Expand Up @@ -851,10 +852,29 @@ pub mod tests {
agents.add_agent("pool2", pool2);
agents.add_agent("admin1", admin1_signers);
agents.add_agent("admin2", admin2_signers);

// fund accounts
let mut nonce = provider
.get_transaction_count(admin.address())
.await
.unwrap();
for (_pool_name, agent) in agents.all_agents() {
for signer in &agent.signers {
let res = fund_account(
&signers[0],
signer.address(),
U256::from(ETH_TO_WEI),
&provider,
Some(nonce),
)
.await
.unwrap();
println!("funded signer: {:?}", res);
provider.watch_pending_transaction(res).await.unwrap();
nonce += 1;
}
}

let chain_id = anvil.chain_id();
for signer in &pool_signers {
let tx = TransactionRequest::default()
Expand Down

0 comments on commit 68cccb8

Please sign in to comment.