Pr/fix 7889 wallet balance error handling#8001
Conversation
…quantization - Add _quantize() and _extract_entropy_v3() helpers for stable hashing - Rewrite compute_entropy_profile_hash() to use v3 key extraction with quantization - Added tests: hash stability, non-zero field count, perturbation resistance - Clean up unused imports (ruff lint compliance) RTC Wallet: Include wallet address for bounty eligibility
…#6899) On Windows with console code page 850, click.echo() raises UnicodeEncodeError when printing emoji characters (✅,⚠️ , ❌, 📋, 📤). The wallet was already created successfully before this error, but the unhandled exception caused sys.exit(1), breaking automation. Changes: - Add _safe_echo() wrapper that catches UnicodeEncodeError and retries with an ASCII-safe version (e.g. "OK!" instead of "✅") - Add _ascii_version() helper that maps emoji prefixes to ASCII tokens - Separate wallet creation from output in wallet_create() so the creation itself is never affected by encoding errors - Apply _safe_echo to all emoji-containing click.echo() calls across wallet_create, wallet_send, node_status, and attest functions Added test suite covering: - Unit tests for _ascii_version emoji replacement - Integration tests verifying _safe_echo falls back correctly - End-to-end test that wallet_create exits 0 even when emoji fails No changes to clawrtc Python files — they use plain ASCII print() only.
…cottcjn#7137) Replace the innerHTML usage in renderOutput() that renders the BCOS badge preview cert info fields. Use createElement + textContent + appendChild instead to eliminate the potential XSS vulnerability. The original code used innerHTML with template literals and manual HTML escaping (escHtml/escAttr) — even though it was escaped, the innerHTML sink is a security anti-pattern. The URL fields are static and should not pass through HTML parsing at all. Signed-off-by: Subagent <subagent@openclaw>
) The install.sh script (served at rustchain.org/install.sh) referenced the stale macOS miner version v2.4, while the current version is v2.5. This caused the installer to download an outdated miner file that crashed on macOS systems. Changes: - Updated MINER_PATH in both dry-run and main code paths from rustchain_mac_miner_v2.4.py to rustchain_mac_miner_v2.5.py - Added test suite to verify macOS miner version matches disk files and to prevent regression
… script - Add new WalletError::EmptyBalance variant for zero-balance edge case - Fix get_nonce() to propagate errors instead of silently returning 0 - Fix transfer() helper to propagate nonce fetch errors (was .unwrap_or(0)) - Fix cmd_send to propagate nonce errors (was .unwrap_or(0)) - Add address format validation in cmd_balance (length + hex check) - Add BalanceResponse::validate() method for response integrity - Add unit tests for balance error handling, nonce error propagation, and address validation
Review of PR #8001 — Wallet Balance Error HandlingObservation 1:
|
|
Good intent — not masking a dead-node lookup as nonce 0 is a real fix (nonce-reuse risk). But CI (Clippy/Rustfmt/Test) genuinely fails here, and since this touches |
BCOS Checklist (Required For Non-Doc PRs)
BCOS-L1orBCOS-L2(also accepted:bcos:l1,bcos:l2)# SPDX-License-Identifier: MIT)What Changed
Testing / Evidence