Skip to content

Commit

Permalink
add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop committed Aug 19, 2024
1 parent f60a2d9 commit 6e4bfbb
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion run_basic_scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,27 @@ jq -r '.root_canister_id' -e sns_canister_ids.json
jq -r '.swap_canister_id' -e sns_canister_ids.json

# Assert the SNS swap lifecycle is in the OPEN state.
[ "$(./get_sns_swap_state.sh | ./bin/idl2json | jq -r '.swap[0].lifecycle')" == "2" ] && echo "OK" || exit 1
(
# Run the command and capture the output
swap_state=$(./get_sns_swap_state.sh | ./bin/idl2json)

# Extract the lifecycle value
lifecycle=$(echo "$swap_state" | jq -r '.swap[0].lifecycle')

# Log the output and extracted lifecycle value
echo "Full output: ${swap_state}"
echo "Extracted lifecycle value: ${lifecycle}"

# Check if the lifecycle is in the OPEN state (2)
if [ "${lifecycle}" == "2" ]; then
echo "OK - SNS swap lifecycle is in the OPEN state (2)"
else
echo "ERROR - SNS swap lifecycle is not in the OPEN state"
echo "Expected: 2 (OPEN state)"
echo "Actual: ${lifecycle}"
exit 1
fi
)

# Assert that the test canister is indeed registered.
[ "$(./get_sns_canisters.sh | ./bin/idl2json | jq -r '.dapps[0]')" == "$(./bin/dfx canister id test)" ] && echo "OK" || exit 1
Expand Down

0 comments on commit 6e4bfbb

Please sign in to comment.