From d87d65fa285486121c97a3173ff618521ae14f9a Mon Sep 17 00:00:00 2001 From: Milan Saxena Date: Mon, 27 Jan 2025 14:34:53 -0800 Subject: [PATCH 1/3] chore: added USDC gasless transfer e2e test --- tests/test_e2e.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/test_e2e.py b/tests/test_e2e.py index ab74f88..eac3128 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -20,6 +20,8 @@ def configure_cdp(): Cdp.configure( api_key_name=os.environ["CDP_API_KEY_NAME"], private_key=os.environ["CDP_API_KEY_PRIVATE_KEY"].replace("\\n", "\n"), + debugging=True, + base_path="https://cloud-api-dev.cbhq.net/platform/" ) @@ -170,3 +172,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") From 76421439eaa9c0be0a48c9c29e965cc510d0468d Mon Sep 17 00:00:00 2001 From: Milan Saxena Date: Mon, 27 Jan 2025 14:38:43 -0800 Subject: [PATCH 2/3] unset dev configuration for sdk --- tests/test_e2e.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_e2e.py b/tests/test_e2e.py index eac3128..19a885b 100644 --- a/tests/test_e2e.py +++ b/tests/test_e2e.py @@ -20,8 +20,6 @@ def configure_cdp(): Cdp.configure( api_key_name=os.environ["CDP_API_KEY_NAME"], private_key=os.environ["CDP_API_KEY_PRIVATE_KEY"].replace("\\n", "\n"), - debugging=True, - base_path="https://cloud-api-dev.cbhq.net/platform/" ) From afa65af5756cd5e0c5ef805b283ef6733323af2f Mon Sep 17 00:00:00 2001 From: Milan Saxena Date: Mon, 27 Jan 2025 14:52:48 -0800 Subject: [PATCH 3/3] updated CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a3b60a..4d0113f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.