Skip to content

Refactor wallet methods to be self-contained with internal transactions#5021

Merged
pwojcikdev merged 5 commits intonanocurrency:developfrom
pwojcikdev:wallet-transaction-self-contained
Feb 1, 2026
Merged

Refactor wallet methods to be self-contained with internal transactions#5021
pwojcikdev merged 5 commits intonanocurrency:developfrom
pwojcikdev:wallet-transaction-self-contained

Conversation

@pwojcikdev
Copy link
Copy Markdown
Contributor

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.

@pwojcikdev pwojcikdev force-pushed the wallet-transaction-self-contained branch from 1ba9d93 to eeccfc4 Compare January 30, 2026 23:02
@gr0vity-dev-bot
Copy link
Copy Markdown

gr0vity-dev-bot commented Jan 31, 2026

Test Results for Commit a805c1a

Pull Request 5021: Results
Overall Status:

Test Case Results

  • 5n4pr_conf_10k_bintree: PASS (Duration: 116s)
  • 5n4pr_conf_10k_change: PASS (Duration: 181s)
  • 5n4pr_conf_change_dependant: PASS (Duration: 126s)
  • 5n4pr_conf_change_independant: PASS (Duration: 136s)
  • 5n4pr_conf_send_dependant: PASS (Duration: 123s)
  • 5n4pr_conf_send_independant: PASS (Duration: 126s)
  • 5n4pr_rocks_10k_bintree: PASS (Duration: 113s)
  • 5n4pr_rocks_10k_change: FAIL (Duration: 272s)
  • Log

Last updated: 2026-02-01 14:23:13 UTC

@pwojcikdev pwojcikdev force-pushed the wallet-transaction-self-contained branch from e67995d to bf73cb3 Compare January 31, 2026 13:30
@pwojcikdev pwojcikdev force-pushed the wallet-transaction-self-contained branch from bf73cb3 to ca5b583 Compare January 31, 2026 13:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _impl methods 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.

@pwojcikdev pwojcikdev merged commit 579b78e into nanocurrency:develop Feb 1, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants