Skip to content
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
10 changes: 3 additions & 7 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
python-version: '3.10'

- name: Install Poetry
uses: snok/install-poetry@v1
Expand All @@ -29,7 +25,7 @@ jobs:
uses: actions/cache@v3
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('poetry.lock') }}
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
Expand Down
39 changes: 19 additions & 20 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,25 @@ def test_wallet_import(wallet_data):
@pytest.mark.e2e
def test_wallet_transfer(imported_wallet):
"""Test wallet transfer."""
try:
imported_wallet.faucet().wait()
except FaucetLimitReachedError:
print("Faucet limit reached, continuing...")

destination_wallet = Wallet.create()

initial_source_balance = Decimal(str(imported_wallet.balances().get("eth", 0)))
initial_dest_balance = Decimal(str(destination_wallet.balances().get("eth", 0)))
initial_source_balance = imported_wallet.balance("eth")
initial_dest_balance = destination_wallet.balance("eth")

if initial_source_balance < 0.0001:
try:
imported_wallet.faucet().wait()
except FaucetLimitReachedError:
print("Faucet limit reached, continuing...")

transfer = imported_wallet.transfer(
amount=Decimal("0.000000001"), asset_id="eth", destination=destination_wallet
)

transfer.wait()
time.sleep(2)
).wait()

assert transfer is not None
assert transfer.status.value == "complete"

final_source_balance = Decimal(str(imported_wallet.balances().get("eth", 0)))
final_dest_balance = Decimal(str(destination_wallet.balances().get("eth", 0)))
final_source_balance = imported_wallet.balance("eth")
final_dest_balance = destination_wallet.balance("eth")

assert final_source_balance < initial_source_balance
assert final_dest_balance > initial_dest_balance
Expand All @@ -100,15 +97,17 @@ def test_wallet_transfer(imported_wallet):
@pytest.mark.e2e
def test_transaction_history(imported_wallet):
"""Test transaction history retrieval."""
try:
imported_wallet.faucet().wait()
except FaucetLimitReachedError:
print("Faucet limit reached, continuing...")

destination_wallet = Wallet.create()

initial_source_balance = imported_wallet.balance("eth")
if initial_source_balance < 0.0001:
try:
imported_wallet.faucet().wait()
except FaucetLimitReachedError:
print("Faucet limit reached, continuing...")

transfer = imported_wallet.transfer(
amount=Decimal("0.0001"), asset_id="eth", destination=destination_wallet
amount=Decimal("0.000000001"), asset_id="eth", destination=destination_wallet
).wait()

time.sleep(10)
Expand Down
Loading