Skip to content

Commit

Permalink
refactor: update test descriptions and logging in bridge e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Feb 24, 2025
1 parent d4f9b82 commit eca8837
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test/bats/helpers/lxly-bridge.bash
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ function wait_for_expected_token() {
local token_mappings_result
local origin_token_address

echo "Waiting for expected origin_token_address $aggkit_node_url @ $enclave..." >&3

while true; do
((attempt++))

Expand Down
12 changes: 6 additions & 6 deletions test/bats/pp/bridge-e2e.bats
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ setup() {
readonly erc20_artifact_path=${ERC20_ARTIFACT_PATH:-"./contracts/erc20mock/ERC20Mock.json"}
}

@test "Native gas token deposit to WETH" {
destination_addr=$sender_addr
@test "Native gas token bridge L1 -> L2" {
run cast call --rpc-url $l2_rpc_url $bridge_addr 'WETHToken() (address)'
assert_success
readonly weth_token_addr=$output

destination_addr=$sender_addr
local initial_receiver_balance=$(cast call --rpc-url "$l2_rpc_url" "$weth_token_addr" "$balance_of_fn_sig" "$destination_addr" | awk '{print $1}')
echo "Initial receiver balance of native token on L2 $initial_receiver_balance" >&3

Expand Down Expand Up @@ -140,19 +140,19 @@ setup() {
assert_success
}

@test "Custom gas token withdrawal L2 -> L1" {
echo "Custom gas token withdrawal (gas token addr: $gas_token_addr, L1 RPC: $l1_rpc_url, L2 RPC: $l2_rpc_url)" >&3
@test "Custom gas token deposit L2 -> L1" {
echo "Custom gas token deposit (gas token addr: $gas_token_addr, L1 RPC: $l1_rpc_url, L2 RPC: $l2_rpc_url)" >&3

local initial_receiver_balance=$(cast call --rpc-url "$l1_rpc_url" "$gas_token_addr" "$balance_of_fn_sig" "$destination_addr" | awk '{print $1}')
assert_success
echo "Receiver balance of gas token on L1 $initial_receiver_balance" >&3

# Deposit token on L2
# Deposit token (on L2)
destination_net=$l1_rpc_network_id
run bridge_asset "$native_token_addr" "$l2_rpc_url"
assert_success

# Claim withdrawal (settle it on the L1)
# Claim L2 deposit (settle it on the L1)
timeout="180"
claim_frequency="10"
destination_net=$l1_rpc_network_id
Expand Down

0 comments on commit eca8837

Please sign in to comment.