Skip to content

Commit bbe22d0

Browse files
committed
chore: add funding checks for debugging
1 parent f6c1661 commit bbe22d0

File tree

2 files changed

+16
-1
lines changed
  • packages/sdk-platforms/rust/zksync-sso-erc4337/crates
    • zksync-sso-erc4337-core/src/erc4337/account/modular_smart_account/deploy
    • zksync-sso-zksyncos-node/src/instance

2 files changed

+16
-1
lines changed

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/src/erc4337/account/modular_smart_account/deploy/user_op.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ mod tests {
134134
start_node_and_deploy_contracts_and_start_bundler_with_config,
135135
},
136136
};
137-
use alloy::primitives::{U256, address};
137+
use alloy::{
138+
primitives::{U256, address},
139+
providers::WalletProvider,
140+
};
138141

139142
#[tokio::test]
140143
// #[ignore = "temporarily disabled"]
@@ -152,6 +155,13 @@ mod tests {
152155
)
153156
.await?;
154157

158+
let signer_address = provider.default_signer_address();
159+
let signer_balance = provider.get_balance(signer_address).await?;
160+
eyre::ensure!(
161+
signer_balance > U256::ZERO,
162+
"Signer wallet not funded: {signer_address} (balance {signer_balance})"
163+
);
164+
155165
let entry_point_address =
156166
address!("0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108");
157167

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-zksyncos-node/src/instance/setup.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ pub(crate) fn setup_zksync_os(
4747
if balance < FUND_AMOUNT_WEI {
4848
fund_wallet_balance(l2_rpc_url, &address, print_logs)?;
4949
}
50+
let new_balance = rpc_get_balance(l2_rpc_url, &address)?;
51+
eyre::ensure!(
52+
new_balance >= FUND_AMOUNT_WEI,
53+
"failed to fund {address}: balance {new_balance} below {FUND_AMOUNT_WEI}"
54+
);
5055
}
5156
}
5257

0 commit comments

Comments
 (0)