Skip to content

Commit

Permalink
adds e2e test, not passing
Browse files Browse the repository at this point in the history
  • Loading branch information
alecps authored and karlb committed Dec 6, 2023
1 parent ba3159f commit 463e338
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions e2e_test/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TOKEN_ADDR=0x471ece3750da237f93b8e339c536989b8978a438
FEE_CURRENCY_WHITELIST_ADDR=0xbb024e9cdcb2f9e34d893630d19611b8a5381b3c
SORTED_ORACLES_ADDR=0xefb84935239dacdecf7c5ba76d8de40b077b7b33
FEE_CURRENCY=0x000000000000000000000000000000000000ce16
FEE_HANDLER=0xcd437749e43a154c07f3553504c68fbfd56b8778

FIXIDITY_1=1000000000000000000000000
ZERO_ADDRESS=0x0000000000000000000000000000000000000000
19 changes: 19 additions & 0 deletions e2e_test/test_base_fee_recipient.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
#shellcheck disable=SC2086
set -eo pipefail
set -x

source shared.sh

# Send token and check balance
balance_before=$(cast balance $FEE_HANDLER)
tx_json=$(cast send --json --private-key $ACC_PRIVKEY $TOKEN_ADDR 'transfer(address to, uint256 value) returns (bool)' 0x000000000000000000000000000000000000dEaD 100)
echo "tx json: $tx_json"
tx_hash=$(echo $tx_json | jq -r '.transactionHash')
echo "tx hash: $tx_hash"
cast tx $tx_hash
cast receipt $tx_hash
balance_after=$(cast balance $FEE_HANDLER)
echo "Balance change: $balance_before -> $balance_after"
# TODO(Alec) calculate expected balance change
[[ $((balance_before + 100)) -eq $balance_after ]] || (echo "Balance did not change as expected"; exit 1)

0 comments on commit 463e338

Please sign in to comment.