Skip to content

Commit 95e8385

Browse files
authored
test: add arbitrum fork test (#6800)
1 parent c5fd67b commit 95e8385

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

crates/anvil/src/eth/backend/fork.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ impl ClientFork {
594594
#[derive(Clone, Debug)]
595595
pub struct ClientForkConfig {
596596
pub eth_rpc_url: String,
597+
/// The block number of the forked block
597598
pub block_number: u64,
599+
/// The hash of the forked block
598600
pub block_hash: B256,
599601
// TODO make provider agnostic
600602
pub provider: Arc<RetryProvider>,

crates/anvil/tests/it/fork.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,3 +1092,21 @@ async fn test_fork_reset_basefee() {
10921092
// basefee of the forked block: <https://etherscan.io/block/18835000>
10931093
assert_eq!(latest.header.base_fee_per_gas.unwrap(), rU256::from(59017001138u64));
10941094
}
1095+
1096+
// <https://github.com/foundry-rs/foundry/issues/6795>
1097+
#[tokio::test(flavor = "multi_thread")]
1098+
async fn test_arbitrum_fork_dev_balance() {
1099+
let (api, handle) = spawn(
1100+
fork_config()
1101+
.with_fork_block_number(None::<u64>)
1102+
.with_eth_rpc_url(Some("https://arb1.arbitrum.io/rpc".to_string())),
1103+
)
1104+
.await;
1105+
1106+
let accounts: Vec<_> = handle.dev_wallets().collect();
1107+
for acc in accounts {
1108+
let balance =
1109+
api.balance(acc.address().to_alloy(), Some(Default::default())).await.unwrap();
1110+
assert_eq!(balance, rU256::from(100000000000000000000u128));
1111+
}
1112+
}

0 commit comments

Comments
 (0)