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
5 changes: 3 additions & 2 deletions core/helpers/agglayer-cdk-common-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ _generate_and_fund_wallet() {
echo "馃洜 Raw wallet JSON output:"
echo "$wallet_json"

PRIVATE_KEY_VALUE=$(echo "$wallet_json" | jq -r '.[0].private_key')
PUBLIC_ADDRESS_VALUE=$(echo "$wallet_json" | jq -r '.[0].address')
# (.data? // .) keeps compatibility with both cast < 1.8 (bare array) and >= 1.8 (versioned envelope)
PRIVATE_KEY_VALUE=$(echo "$wallet_json" | jq -r '(.data? // .)[0].private_key')
PUBLIC_ADDRESS_VALUE=$(echo "$wallet_json" | jq -r '(.data? // .)[0].address')

echo "馃洜 Extracted PRIVATE_KEY: $PRIVATE_KEY_VALUE"
echo "馃洜 Extracted PUBLIC_ADDRESS: $PUBLIC_ADDRESS_VALUE"
Expand Down
3 changes: 2 additions & 1 deletion core/helpers/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function _setup_vars() {
echo "鈩癸笍 PROJECT_ROOT=$PROJECT_ROOT BATS_LIB_PATH=$BATS_LIB_PATH" >&3

# foo address for whatever it's needed for
foo=$(cast wallet new --json | jq .[0])
# (.data? // .) keeps compatibility with both cast < 1.8 (bare array) and >= 1.8 (versioned envelope)
foo=$(cast wallet new --json | jq '(.data? // .)[0]')
foo_address=$(echo "$foo" | jq -r .address)
foo_private_key=$(echo "$foo" | jq -r .private_key)
export foo_address foo_private_key
Expand Down
5 changes: 3 additions & 2 deletions core/helpers/scripts/bridging.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ function polycli_bridge_asset_get_info() {
fi

#聽get the event data for the bridge asset
# (.data? // .) keeps compatibility with both cast < 1.8 (bare output) and >= 1.8 (versioned envelope)
bridge_deposit_log_data=$(cast receipt --rpc-url $rpc_url $bridge_tx_hash --json | jq -r \
--arg bridge_addr "$bridge_addr" '
.logs[]
(.data? // .) | .logs[]
| select((.address|ascii_downcase) == ($bridge_addr | ascii_downcase)
and .topics == ["0x501781209a1f8899323b96b4ef08b168df93e0a90c673d1e4cce39366cb62f9b"])
| .data')
Expand All @@ -51,7 +52,7 @@ function polycli_bridge_asset_get_info() {
#聽get the deposit count by decoding the event
# BridgeEvent (uint8 leafType, uint32 originNetwork, address originAddress, uint32 destinationNetwork, address destinationAddress, uint256 amount, bytes metadata, uint32 depositCount)
event_sig='BridgeEvent(uint8,uint32,address,uint32,address,uint256,bytes,uint32)'
deposit_count=$(cast decode-event "$bridge_deposit_log_data" --sig "$event_sig" --json | jq -r '.[7]')
deposit_count=$(cast decode-event "$bridge_deposit_log_data" --sig "$event_sig" --json | jq -r '(.data? // .)[7]')
if [[ -z "$deposit_count" ]]; then
echo "Deposit count is empty"
exit 1
Expand Down