[codex] fix wallet_balance local wallet address resolution#251
Merged
Scottcjn merged 1 commit intoJul 4, 2026
Merged
Conversation
jaxint
approved these changes
Jul 3, 2026
jaxint
left a comment
There was a problem hiding this comment.
PR Review
Reviewer: @jaxint
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
Summary
This PR addresses: [codex] fix wallet_balance local wallet address
Code Review
Changes Reviewed:
- Files: 2
- Lines: +29/-6
Assessment: ✅ Approved
The changes follow the project's coding standards and address the issue described in the PR title. The implementation is clean and minimal.
Testing
- Code changes are minimal and focused
- No additional test coverage required for this fix
Recommendation
APPROVE - Ready for merge.
Review submitted via RustChain Bounty System
RTC bounty claim: 40 RTC per review (Bounty #73)
RTC RewardThis merged PR earned 5 RTC — sent to |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix:
wallet_balance()should resolve local wallet IDs to their RTC addressBug
wallet_balance()loads a local wallet from the keystore, but still queries the node with the originalwallet_id:This breaks the common local-wallet flow because the RustChain balance endpoint expects the wallet address. The neighboring
wallet_history()tool already resolves local wallet IDs towallet["address"], so the two tools are currently inconsistent.Fix
wallet_idtowallet["address"]when the wallet exists locally.Tests
test_mcp_wallet_balance_with_mockto assert the request path uses the created wallet address.test_mcp_wallet_balance_accepts_direct_addressto verify the direct-address path still works.Scope
Small, isolated change:
rustchain_mcp/server.pytests/test_wallet_tools.pyValidation
wallet_history()already normalizes local wallet IDs to addresses, so this change makeswallet_balance()consistent with the existing local-wallet path.python -m pytest -q tests/test_wallet_tools.py -k 'test_mcp_wallet_balance_with_mock or test_mcp_wallet_balance_accepts_direct_address'python -m pytest -q tests/test_bottube_endpoints.py -k 'test_wallet_balance_uses_path_param'3 passedRTC payout wallet:
RTCc78142b4cc31531e913c4082bc5d771eb0a91ac1