Skip to content
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

chore: added USDC gasless transfer e2e test #92

Merged
merged 3 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Added

- Add E2E test for gasless transfers `Wallet.createTransfer({..., gasless: true})`

### Fixed

- Fixed a bug where non-checksummed asset IDs were throwing an error.
Expand Down
24 changes: 24 additions & 0 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,27 @@ def test_historical_balances(imported_wallet):
balances = list(imported_wallet.default_address.historical_balances("eth"))
assert balances
assert all(balance.amount > 0 for balance in balances)


@pytest.mark.e2e
def test_gasless_transfer(imported_wallet):
"""Test gasless transfer."""
destination_wallet = Wallet.create()

initial_source_balance = imported_wallet.balance("usdc")
initial_dest_balance = destination_wallet.balance("usdc")

transfer = imported_wallet.transfer(
amount=Decimal("0.000001"), asset_id="usdc", gasless=True, destination=destination_wallet
).wait()

time.sleep(20)

assert transfer.status.value == "complete"

final_source_balance = imported_wallet.balance("usdc")
final_dest_balance = destination_wallet.balance("usdc")

assert final_source_balance < initial_source_balance
assert final_dest_balance > initial_dest_balance
assert final_dest_balance == Decimal("0.000001")
Loading