-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: changes to run pipeline with local chain
- Loading branch information
1 parent
802f0e5
commit d386d41
Showing
4 changed files
with
68 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: 'Check Token Balances' | ||
description: 'Checks token balances on specified blockchain containers.' | ||
|
||
inputs: | ||
container: | ||
description: 'Docker container name' | ||
required: true | ||
address: | ||
description: 'Wallet address to check the balance' | ||
required: true | ||
expected_amount: | ||
description: 'Expected token amount' | ||
required: true | ||
expected_denom: | ||
description: 'Expected token denomination' | ||
required: true | ||
expected_length: | ||
description: 'Expected number of balance entries' | ||
required: true | ||
default: '1' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Check token balances and validate | ||
shell: bash | ||
run: | | ||
# Fetch and process balances | ||
json_output=$(docker exec ${{ inputs.container }} agd query bank balances ${{ inputs.address }} -o json) | ||
balances=$(echo "$json_output" | jq '.balances') | ||
length=$(echo "$balances" | jq 'length') | ||
amount=$(echo "$balances" | jq -r '.[0].amount') | ||
denom=$(echo "$balances" | jq -r '.[0].denom') | ||
# Validate balances | ||
if [ "$length" -ne "${{ inputs.expected_length }}" ] || [ "$amount" != "${{ inputs.expected_amount }}" ] || [ "$denom" != "${{ inputs.expected_denom }}" ]; then | ||
echo "Failure: Expected ${{ inputs.expected_length }} entries with amount ${{ inputs.expected_amount }} and denom ${{ inputs.expected_denom }}, found length $length, amount $amount, denom $denom." | ||
exit 1 | ||
else | ||
echo "Success: Balance check passed with correct length and values." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters