diff --git a/.github/scripts/wallet/test-send.sh b/.github/scripts/wallet/test-send.sh index 60df34fe3..726d089a9 100755 --- a/.github/scripts/wallet/test-send.sh +++ b/.github/scripts/wallet/test-send.sh @@ -32,8 +32,11 @@ RECEIVER=$(cat "$PUBKEY_FILE") # Use minimal amounts to avoid draining the account # 1 nanomina = smallest unit AMOUNT="1" -# 1000000 nanomina = 0.001 MINA (small but acceptable fee) -FEE="1000000" +# 1000000 nanomina = 0.1 MINA (small but acceptable fee) +FEE="100000000" + +# Optional memo from environment variable (empty by default) +MEMO="${MINA_E2E_TEST_MEMO:-}" echo "Test: Send transaction to same account (e2e test)" echo "Key file: $KEY_FILE" @@ -41,20 +44,32 @@ echo "Receiver: $RECEIVER" echo "Amount: $AMOUNT nanomina" echo "Fee: $FEE nanomina" echo "Node endpoint: $NODE_ENDPOINT" +if [ -n "$MEMO" ]; then + echo "Memo: $MEMO" +fi echo "" # Export password for the CLI export MINA_PRIVKEY_PASS="$PASSWORD" +# Build send command arguments +SEND_ARGS=( + --from "$KEY_FILE" + --to "$RECEIVER" + --amount "$AMOUNT" + --fee "$FEE" + --node "$NODE_ENDPOINT" + --network devnet +) + +# Add memo if running in CI +if [ -n "$MEMO" ]; then + SEND_ARGS+=(--memo "$MEMO") +fi + # Run the wallet send command echo "Sending transaction..." -SEND_OUTPUT=$(./target/release/mina wallet send \ - --from "$KEY_FILE" \ - --to "$RECEIVER" \ - --amount "$AMOUNT" \ - --fee "$FEE" \ - --node "$NODE_ENDPOINT" \ - --network devnet 2>&1 || true) +SEND_OUTPUT=$(./target/release/mina wallet send "${SEND_ARGS[@]}" 2>&1 || true) echo "Send command output:" echo "$SEND_OUTPUT" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 130dc0280..06d9efbc4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -265,6 +265,7 @@ jobs: env: MINA_PRIVKEY_PASS: ${{ secrets.MINA_PRIVKEY_PASS }} MINA_NODE_ENDPOINT: http://mina-rust-plain-1.gcp.o1test.net/graphql + MINA_E2E_TEST_MEMO: MINA_RUST PR#${{ github.event.pull_request.number }} run: make test-wallet build-tests: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4095eb1ce..5cb49948d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 should have on the ledger. Also, document the different types of transactions that can be used to modify the ledger ([#1541](https://github.com/o1-labs/mina-rust/pull/1541)) +- **CLI**: introduce a subcommand `wallet` to be able to send transactions, get + the public key and address from the secret key, get balance and generate + wallets from the CLI. End-to-end tests are added in the CI and a new target + `make test-wallet` has been added. This focuses on basic payments + ([#1543](https://github.com/o1-labs/mina-rust/pull/1543)). ### Changed