File tree Expand file tree Collapse file tree 7 files changed +67
-18
lines changed
Expand file tree Collapse file tree 7 files changed +67
-18
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -euo pipefail
4-
53# Test the wallet balance command with --from key file (text format)
64
5+ # Check for required environment variables before enabling strict mode
6+ if [ -z " ${MINA_NODE_ENDPOINT:- } " ]; then
7+ echo " Error: MINA_NODE_ENDPOINT environment variable is not set"
8+ echo " Please set it to a GraphQL endpoint URL, e.g.:"
9+ echo " export MINA_NODE_ENDPOINT=http://mina-rust-plain-1.gcp.o1test.net/graphql"
10+ exit 1
11+ fi
12+
13+ set -euo pipefail
14+
715SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
816REPO_ROOT=" $( cd " $SCRIPT_DIR /../../.." && pwd) "
917cd " $REPO_ROOT "
@@ -14,7 +22,7 @@ PASSWORD="test-password"
1422
1523echo " Test: Verify --from option works with key file (text format)"
1624export MINA_PRIVKEY_PASS=" $PASSWORD "
17- BALANCE_OUTPUT=$( ./target/release/mina wallet balance --from " $KEY_FILE " --endpoint " http://mina-rust-plain-1.gcp.o1test.net/graphql " --format text 2>&1 || true)
25+ BALANCE_OUTPUT=$( ./target/release/mina wallet balance --from " $KEY_FILE " --endpoint " $MINA_NODE_ENDPOINT " --format text 2>&1 || true)
1826
1927echo " Balance command output:"
2028echo " $BALANCE_OUTPUT "
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -euo pipefail
4-
53# Test the wallet balance command JSON format output structure
64
5+ # Check for required environment variables before enabling strict mode
6+ if [ -z " ${MINA_NODE_ENDPOINT:- } " ]; then
7+ echo " Error: MINA_NODE_ENDPOINT environment variable is not set"
8+ echo " Please set it to a GraphQL endpoint URL, e.g.:"
9+ echo " export MINA_NODE_ENDPOINT=http://mina-rust-plain-1.gcp.o1test.net/graphql"
10+ exit 1
11+ fi
12+
13+ set -euo pipefail
14+
715SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
816REPO_ROOT=" $( cd " $SCRIPT_DIR /../../.." && pwd) "
917cd " $REPO_ROOT "
1826echo " Test: Verify JSON format output structure"
1927JSON_OUTPUT=$( ./target/release/mina wallet balance \
2028 --address " B62qkiqPXFDayJV8JutYvjerERZ35EKrdmdcXh3j1rDUHRs1bJkFFcX" \
21- --endpoint " http://mina-rust-plain-1.gcp.o1test.net/graphql " \
29+ --endpoint " $MINA_NODE_ENDPOINT " \
2230 --format json 2>&1 || true)
2331
2432echo " JSON format output:"
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -euo pipefail
4-
53# Test the wallet balance command with --address (JSON format)
64
5+ # Check for required environment variables before enabling strict mode
6+ if [ -z " ${MINA_NODE_ENDPOINT:- } " ]; then
7+ echo " Error: MINA_NODE_ENDPOINT environment variable is not set"
8+ echo " Please set it to a GraphQL endpoint URL, e.g.:"
9+ echo " export MINA_NODE_ENDPOINT=http://mina-rust-plain-1.gcp.o1test.net/graphql"
10+ exit 1
11+ fi
12+
13+ set -euo pipefail
14+
715SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
816REPO_ROOT=" $( cd " $SCRIPT_DIR /../../.." && pwd) "
917cd " $REPO_ROOT "
1927PUBLIC_KEY=$( cat " tests/files/accounts/test-block-producer.pub" )
2028
2129echo " Test: Verify --address option works with public key (JSON format)"
22- BALANCE_JSON=$( ./target/release/mina wallet balance --address " $PUBLIC_KEY " --endpoint " http://mina-rust-plain-1.gcp.o1test.net/graphql " --format json 2>&1 || true)
30+ BALANCE_JSON=$( ./target/release/mina wallet balance --address " $PUBLIC_KEY " --endpoint " $MINA_NODE_ENDPOINT " --format json 2>&1 || true)
2331
2432echo " Balance command output:"
2533echo " $BALANCE_JSON "
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -euo pipefail
4-
53# Test the wallet balance command error when no account specified
64
5+ # Check for required environment variables before enabling strict mode
6+ if [ -z " ${MINA_NODE_ENDPOINT:- } " ]; then
7+ echo " Error: MINA_NODE_ENDPOINT environment variable is not set"
8+ echo " Please set it to a GraphQL endpoint URL, e.g.:"
9+ echo " export MINA_NODE_ENDPOINT=http://mina-rust-plain-1.gcp.o1test.net/graphql"
10+ exit 1
11+ fi
12+
13+ set -euo pipefail
14+
715SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
816REPO_ROOT=" $( cd " $SCRIPT_DIR /../../.." && pwd) "
917cd " $REPO_ROOT "
1018
1119echo " Test: Verify error when no account specified"
12- ERROR_OUTPUT=$( ./target/release/mina wallet balance --endpoint " http://mina-rust-plain-1.gcp.o1test.net/graphql " 2>&1 || true)
20+ ERROR_OUTPUT=$( ./target/release/mina wallet balance --endpoint " $MINA_NODE_ENDPOINT " 2>&1 || true)
1321
1422echo " Command output:"
1523echo " $ERROR_OUTPUT "
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -euo pipefail
4-
53# Test the wallet balance command text format output structure
64
5+ # Check for required environment variables before enabling strict mode
6+ if [ -z " ${MINA_NODE_ENDPOINT:- } " ]; then
7+ echo " Error: MINA_NODE_ENDPOINT environment variable is not set"
8+ echo " Please set it to a GraphQL endpoint URL, e.g.:"
9+ echo " export MINA_NODE_ENDPOINT=http://mina-rust-plain-1.gcp.o1test.net/graphql"
10+ exit 1
11+ fi
12+
13+ set -euo pipefail
14+
715SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
816REPO_ROOT=" $( cd " $SCRIPT_DIR /../../.." && pwd) "
917cd " $REPO_ROOT "
1018
1119echo " Test: Verify text format output structure"
1220TEXT_OUTPUT=$( ./target/release/mina wallet balance \
1321 --address " B62qkiqPXFDayJV8JutYvjerERZ35EKrdmdcXh3j1rDUHRs1bJkFFcX" \
14- --endpoint " http://mina-rust-plain-1.gcp.o1test.net/graphql " \
22+ --endpoint " $MINA_NODE_ENDPOINT " \
1523 --format text 2>&1 || true)
1624
1725echo " Text format output:"
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- set -euo pipefail
4-
53# Test the wallet send command by sending a transaction to the same account
64# Uses a very small fee to avoid draining the account on each PR
75
6+ # Check for required environment variables before enabling strict mode
7+ if [ -z " ${MINA_NODE_ENDPOINT:- } " ]; then
8+ echo " Error: MINA_NODE_ENDPOINT environment variable is not set"
9+ echo " Please set it to a GraphQL endpoint URL, e.g.:"
10+ echo " export MINA_NODE_ENDPOINT=http://mina-rust-plain-1.gcp.o1test.net/graphql"
11+ exit 1
12+ fi
13+
14+ set -euo pipefail
15+
816SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
917REPO_ROOT=" $( cd " $SCRIPT_DIR /../../.." && pwd) "
1018cd " $REPO_ROOT "
1119
1220# Define test parameters
1321KEY_FILE=" tests/files/accounts/test-wallet"
1422PUBKEY_FILE=" tests/files/accounts/test-wallet.pub"
15- NODE_ENDPOINT=" ${ MINA_NODE_ENDPOINT:- http :// mina-rust-plain-1.gcp.o1test.net / graphql} "
23+ NODE_ENDPOINT=" $MINA_NODE_ENDPOINT "
1624
1725# Password from environment variable (set in GitHub secrets)
1826# Default to "test" for local testing
Original file line number Diff line number Diff line change @@ -264,6 +264,7 @@ jobs:
264264 - name : Run wallet tests
265265 env :
266266 MINA_PRIVKEY_PASS : ${{ secrets.MINA_PRIVKEY_PASS }}
267+ MINA_NODE_ENDPOINT : http://mina-rust-plain-1.gcp.o1test.net/graphql
267268 run : make test-wallet
268269
269270 build-tests :
You can’t perform that action at this time.
0 commit comments