-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: test Safe on Sepolia & Pimlico #20
Conversation
d5166a2
to
b511989
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async fn use_faucet( | ||
provider: ReqwestProvider, | ||
faucet: LocalSigner<SigningKey>, | ||
amount: U256, | ||
to: Address, | ||
) -> eyre::Result<()> { | ||
// Basic check (which we can tune) to make sure we don't use excessive | ||
// amounts (e.g. 0.1) of test ETH. It is not infinite, so we should use | ||
// the minimum amount necessary. | ||
assert!(amount < U256::from(20), "You probably don't need that much"); | ||
|
||
ProviderBuilder::new() | ||
.with_recommended_fillers() | ||
.wallet(EthereumWallet::new(faucet)) | ||
.on_provider(provider.clone()) | ||
.send_transaction( | ||
TransactionRequest::default().with_to(to).with_value(amount), | ||
) | ||
.await? | ||
.watch() | ||
.await?; | ||
let balance = provider.get_balance(to).await?; | ||
assert_eq!(balance, amount); | ||
|
||
Ok(()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! we should share this with all tests I think 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah welcome to use it!
429a43d
to
5831cba
Compare
Tests the Safe code against Sepolia and Pimlico
E.g. transaction: https://sepolia.etherscan.io/address/0x07422e736d74dbb0b666cb9dbd6424d9173f183d#internaltx