Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifechukwudaniel committed Feb 12, 2025
1 parent e97fea9 commit 3802a5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contracts/src/token/erc20/extensions/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl IErc20Wrapper for Erc20Wrapper {
return Err(Error::InvalidSender(ERC20InvalidSender {
sender: contract::address(),
}));
}
}

self.safe_erc20.safe_transfer_from(
self.underlying(),
Expand Down
15 changes: 9 additions & 6 deletions examples/erc20-wrapper/tests/erc20wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ mod deposit_to {

use super::*;


#[e2e::test]
async fn executes_with_approval(alice: Account, bob: Account) -> Result<()> {
async fn executes_with_approval(
alice: Account,
bob: Account,

Check warning on line 94 in examples/erc20-wrapper/tests/erc20wrapper.rs

View workflow job for this annotation

GitHub Actions / tests

unused variable: `bob`
) -> Result<()> {
let initial_supply = uint!(1000_U256);
let (contract_addr, asset_addr) = deploy(&alice, U256::ZERO).await?;
let alice_address = alice.address();
Expand All @@ -99,12 +101,13 @@ mod deposit_to {

_ = watch!(asset.mint(alice_address, initial_supply))?;
_ = watch!(asset.approve(alice_address, initial_supply))?;
let receipt = send!(contract.depositFor(alice_address, initial_supply))?;
let receipt =
send!(contract.depositFor(alice_address, initial_supply))?;
println!("receipt: {:#?}", receipt);
Ok(())
}

#[e2e::test]
#[e2e::test]
async fn reverts_when_invalid_asset(alice: Account) -> Result<()> {
let invalid_asset = alice.address();
let contract_addr = alice
Expand All @@ -117,8 +120,8 @@ mod deposit_to {
let err = send!(contract.depositFor(invalid_asset, uint!(10_U256)))

Check warning on line 120 in examples/erc20-wrapper/tests/erc20wrapper.rs

View workflow job for this annotation

GitHub Actions / tests

unused variable: `err`
.expect_err("should return `InvalidAsset`");
// assert!(
// err.reverted_with(Erc20Wrapper::InvalidAsset { asset: invalid_asset })
// );
// err.reverted_with(Erc20Wrapper::InvalidAsset { asset:
// invalid_asset }) );

Ok(())
}
Expand Down

0 comments on commit 3802a5a

Please sign in to comment.