Skip to content

Commit

Permalink
Merge pull request casper-network#4605 from rafal-ch/fixes_for_bond_i…
Browse files Browse the repository at this point in the history
…ts_test

Fixes for bond its test
  • Loading branch information
bradjohnl authored Mar 18, 2024
2 parents bd731db + 9904bca commit cb658bc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 3 additions & 6 deletions utils/nctl/sh/contracts-auction/do_bid_withdraw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function main()
fi

log "... sending deploy"
DEPLOY_RESULT =$($PATH_TO_CLIENT put-deploy \
DEPLOY_RESULT=$($PATH_TO_CLIENT put-deploy \
--chain-name "$CHAIN_NAME" \
--node-address "$NODE_ADDRESS" \
--payment-amount "$GAS_PAYMENT" \
Expand All @@ -65,7 +65,7 @@ function main()
--session-arg "$(get_cl_arg_u512 'amount' "$AMOUNT")" \
--session-arg "$(get_cl_arg_opt_uref 'unbond_purse' "$BIDDER_MAIN_PURSE_UREF")" \
--session-path "$PATH_TO_CONTRACT")
if [ ! -z "DEPLOY_RESULT" ]; then
if [ -z "$DEPLOY_RESULT" ]; then
log "failed to get deploy result"
log "... node address: $NODE_ADDRESS"
exit 1
Expand All @@ -74,10 +74,7 @@ function main()
fi

log "... getting deploy hash"
DEPLOY_HASH=$("$DEPLOY_RESULT"
| jq '.result.deploy_hash' \
| sed -e 's/^"//' -e 's/"$//'
)
DEPLOY_HASH=$(echo $DEPLOY_RESULT | jq -r '.result.deploy_hash')

if [ "$QUIET" != "TRUE" ]; then
log "deploy dispatched:"
Expand Down
2 changes: 2 additions & 0 deletions utils/nctl/sh/scenarios/configs/bond_its.config.toml.override
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[binary_port_server]
allow_request_get_all_values = true
2 changes: 1 addition & 1 deletion utils/nctl/sh/utils/accounts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ function get_main_purse_uref()
source "$NCTL"/sh/views/view_chain_account.sh \
account-key="$ACCOUNT_KEY" \
root-hash="$STATE_ROOT_HASH" \
| jq '.stored_value.Account.main_purse' \
| jq '.stored_value.AddressableEntity.main_purse' \
| sed -e 's/^"//' -e 's/"$//'
}
10 changes: 8 additions & 2 deletions utils/nctl/sh/views/view_chain_account.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ source "$NCTL"/sh/utils/main.sh
NODE_ADDRESS=$(get_node_address_rpc)
STATE_ROOT_HASH=${STATE_ROOT_HASH:-$(get_state_root_hash)}

$(get_path_to_client) query-global-state \
ADDRESSABLE_ENTITY=$($(get_path_to_client) query-global-state \
--node-address "$NODE_ADDRESS" \
--state-root-hash "$STATE_ROOT_HASH" \
--key "$ACCOUNT_KEY" \
| jq '.result'
| jq -r '.result.stored_value.CLValue.parsed')

$(get_path_to_client) query-global-state \
--node-address "$NODE_ADDRESS" \
--state-root-hash "$STATE_ROOT_HASH" \
--key "$ADDRESSABLE_ENTITY" \
| jq -r '.result'

0 comments on commit cb658bc

Please sign in to comment.