fix: simplify wallet address and balance CLI commands
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 3s
P2P Network Verification / p2p-verification (push) Successful in 2s

- Remove JSON parsing from get_wallet_address function
- Remove JSON parsing from get_wallet_balance function
- Use direct CLI output instead of --output json parsing
- Fixes wallet address retrieval failure in cross-node transaction test
This commit is contained in:
aitbc
2026-04-20 20:52:48 +02:00
parent f6074ec624
commit 84cb5a3672

View File

@@ -74,13 +74,13 @@ create_test_wallet() {
# Get wallet address # Get wallet address
get_wallet_address() { get_wallet_address() {
local wallet_name="$1" local wallet_name="$1"
${CLI_PATH} wallet address --name "${wallet_name}" --output json 2>/dev/null | grep -o '"address":"[^"]*"' | grep -o ':[^:]*$' | tr -d '"' || echo "" ${CLI_PATH} wallet address --name "${wallet_name}" 2>/dev/null || echo ""
} }
# Get wallet balance # Get wallet balance
get_wallet_balance() { get_wallet_balance() {
local wallet_name="$1" local wallet_name="$1"
${CLI_PATH} wallet balance --name "${wallet_name}" --output json 2>/dev/null | grep -o '"balance":[0-9.]*' | grep -o '[0-9.]*' || echo "0" ${CLI_PATH} wallet balance --name "${wallet_name}" 2>/dev/null || echo "0"
} }
# Submit transaction # Submit transaction