Refactor wallet methods to be self-contained with internal transactions#5021
Merged
pwojcikdev merged 5 commits intonanocurrency:developfrom Feb 1, 2026
Merged
Conversation
1ba9d93 to
eeccfc4
Compare
Test Results for Commit a805c1aPull Request 5021: Results Test Case Results
Last updated: 2026-02-01 14:23:13 UTC |
e67995d to
bf73cb3
Compare
bf73cb3 to
ca5b583
Compare
ca5b583 to
4a4b6e8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors wallet and wallets methods to manage transactions internally, simplifying the wallet API by removing the requirement for callers to pass transaction objects. The refactoring makes the wallet interface cleaner and easier to use while maintaining the same functionality.
Changes:
- Added new public wallet methods that create transactions internally (e.g.,
deterministic_insert(),enter_password(),get_seed(),set_representative()) - Introduced private
_implmethods that accept transactions for internal use and batching scenarios - Removed the
nano::test::system::account()helper method as it's no longer needed with the simplified API - Updated all callers throughout the codebase to use the new transaction-free API
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| nano/node/wallet.hpp | Added new public API methods without transaction parameters and private _impl methods that accept transactions; marked wallet_store methods as const where appropriate |
| nano/node/wallet.cpp | Implemented new public methods that create transactions and delegate to _impl methods; added helper methods like is_locked(), accounts(), get_seed(), etc. |
| nano/test_common/system.hpp | Removed the account() helper method declaration |
| nano/test_common/system.cpp | Removed the account() helper method implementation |
| nano/slow_test/node.cpp | Updated tests to use new wallet API without transactions |
| nano/rpc_test/rpc.cpp | Updated RPC tests to use simplified wallet methods; improved wallet_export test to validate by importing |
| nano/qt_test/qt.cpp | Updated Qt tests to use accounts().front() pattern instead of removed system.account() |
| nano/qt/qt.cpp | Updated Qt implementation to use new wallet API throughout |
| nano/node/json_handler.cpp | Simplified RPC handlers by removing transaction management for wallet operations |
| nano/node/cli.cpp | Updated CLI commands to use new wallet API |
| nano/node/node.cpp | Updated backup_wallet to use new API |
| nano/node/websocket.cpp | Updated to use new exists_any() method |
| nano/node/ipc/ipc_broker.cpp | Updated to use new exists_any() method |
| nano/core_test/wallets.cpp | Added test for new create_from_json() method; updated existing tests |
| nano/core_test/wallet.cpp | Updated wallet tests to use new API |
| nano/core_test/vote_processor.cpp | Updated to use set_representative() |
| nano/core_test/system.cpp | Updated test to use accounts() |
| nano/core_test/node.cpp | Updated node tests to use new wallet API |
| nano/core_test/network.cpp | Updated network test to use set_representative() |
| nano/nano_wallet/entry.cpp | Updated wallet daemon to use accounts() and deterministic_insert() |
| nano/node/vote_generator.hpp | Removed unnecessary wallet.hpp include |
| nano/node/node.hpp | Removed unnecessary wallet.hpp include |
| nano/node/fwd.hpp | Added forward declaration for wallet class |
| nano/node/json_handler.hpp | Changed to use forward declaration instead of full wallet.hpp include |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Refactor wallet and wallets methods to be self-contained by managing transactions internally rather than requiring callers to pass them in. This simplifies the wallet API by hiding transaction management from callers and makes further refactoring easier.