Skip to content

Commit

Permalink
fix: consolidate naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Sep 18, 2024
1 parent 9600d4d commit e6edbcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/bridge-e2e.bats
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ setup() {
# Download the genesis file
readonly bridge_default_address=$(jq -r ".genesis[] | select(.contractName == \"PolygonZkEVMBridge proxy\") | .address" ./tmp/cdk/genesis/genesis.json)

readonly skey=${SENDER_PRIVATE_KEY:-"12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"}
readonly sender_private_key=${SENDER_PRIVATE_KEY:-"12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"}
readonly destination_net=${DESTINATION_NET:-"1"}
readonly destination_addr=${DESTINATION_ADDRESS:-"0x0bb7AA0b4FdC2D2862c088424260e99ed6299148"}
readonly ether_value=${ETHER_VALUE:-"0.0200000054"}
Expand All @@ -31,7 +31,7 @@ setup() {
readonly dry_run=${DRY_RUN:-"false"}

readonly amount=$(cast to-wei $ether_value ether)
readonly current_addr="$(cast wallet address --private-key $skey)"
readonly sender_addr="$(cast wallet address --private-key $sender_private_key)"
readonly l1_rpc_network_id=$(cast call --rpc-url $l1_rpc_url $bridge_addr 'networkID()(uint32)')
readonly l2_rpc_network_id=$(cast call --rpc-url $l2_rpc_url $bridge_addr 'networkID()(uint32)')
}
Expand Down
10 changes: 5 additions & 5 deletions test/helpers/lxly-bridge-test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ function deposit () {

if [[ $token_addr == "0x0000000000000000000000000000000000000000" ]]; then
echo "Checking the current ETH balance: " >&3
cast balance -e --rpc-url $l1_rpc_url $current_addr >&3
cast balance -e --rpc-url $l1_rpc_url $sender_addr >&3
else
echo "Checking the current token balance for token at $token_addr: " >&3
cast call --rpc-url $l1_rpc_url $token_addr 'balanceOf(address)(uint256)' $current_addr >&3
cast call --rpc-url $l1_rpc_url $token_addr 'balanceOf(address)(uint256)' $sender_addr >&3
fi

echo "Attempting to deposit $amount wei to net $destination_net for token $token_addr" >&3
Expand All @@ -17,9 +17,9 @@ function deposit () {
cast calldata $deposit_sig $destination_net $destination_addr $amount $token_addr $is_forced $meta_bytes
else
if [[ $token_addr == "0x0000000000000000000000000000000000000000" ]]; then
cast send --legacy --private-key $skey --value $amount --rpc-url $l1_rpc_url $bridge_addr $deposit_sig $destination_net $destination_addr $amount $token_addr $is_forced $meta_bytes
cast send --legacy --private-key $sender_private_key --value $amount --rpc-url $l1_rpc_url $bridge_addr $deposit_sig $destination_net $destination_addr $amount $token_addr $is_forced $meta_bytes
else
cast send --legacy --private-key $skey --rpc-url $l1_rpc_url $bridge_addr $deposit_sig $destination_net $destination_addr $amount $token_addr $is_forced $meta_bytes
cast send --legacy --private-key $sender_private_key --rpc-url $l1_rpc_url $bridge_addr $deposit_sig $destination_net $destination_addr $amount $token_addr $is_forced $meta_bytes
fi
fi
}
Expand Down Expand Up @@ -69,7 +69,7 @@ function claim() {
cast calldata $claim_sig "$in_merkle_proof" "$in_rollup_merkle_proof" $in_global_index $in_main_exit_root $in_rollup_exit_root $in_orig_net $in_orig_addr $in_dest_net $in_dest_addr $in_amount $in_metadata
cast call --rpc-url $l2_rpc_url $bridge_addr $claim_sig "$in_merkle_proof" "$in_rollup_merkle_proof" $in_global_index $in_main_exit_root $in_rollup_exit_root $in_orig_net $in_orig_addr $in_dest_net $in_dest_addr $in_amount $in_metadata
else
cast send --legacy --rpc-url $l2_rpc_url --private-key $skey $bridge_addr $claim_sig "$in_merkle_proof" "$in_rollup_merkle_proof" $in_global_index $in_main_exit_root $in_rollup_exit_root $in_orig_net $in_orig_addr $in_dest_net $in_dest_addr $in_amount $in_metadata
cast send --legacy --rpc-url $l2_rpc_url --private-key $sender_private_key $bridge_addr $claim_sig "$in_merkle_proof" "$in_rollup_merkle_proof" $in_global_index $in_main_exit_root $in_rollup_exit_root $in_orig_net $in_orig_addr $in_dest_net $in_dest_addr $in_amount $in_metadata
fi


Expand Down

0 comments on commit e6edbcb

Please sign in to comment.