Skip to content

refactor(key-wallet): drop function to create unisgned transactions in WalletManager and in ManagedWalletInfo#483

Merged
xdustinface merged 1 commit intov0.42-devfrom
refactor/drop-unsigned-tx-building
Feb 28, 2026
Merged

refactor(key-wallet): drop function to create unisgned transactions in WalletManager and in ManagedWalletInfo#483
xdustinface merged 1 commit intov0.42-devfrom
refactor/drop-unsigned-tx-building

Conversation

@ZocoLini
Copy link
Collaborator

@ZocoLini ZocoLini commented Feb 27, 2026

I am removing this with the idea of improving TransactionBuilder struct logic and let it handle how to build signed/unsigned transaction, it makes more sense to me to use the TransactionBuilder since we already have one

Summary by CodeRabbit

  • Breaking Changes
    • Removed support for creating unsigned payment transactions via the wallet API and manager; callers must use alternative transaction flows.
    • Removed related transaction error types and mappings; error surface for transaction creation has changed.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f956b47 and 614b36e.

📒 Files selected for processing (4)
  • key-wallet-manager/src/wallet_manager/mod.rs
  • key-wallet-manager/src/wallet_manager/transaction_building.rs
  • key-wallet/src/wallet/managed_wallet_info/transaction_building.rs
  • key-wallet/src/wallet/managed_wallet_info/wallet_info_interface.rs
💤 Files with no reviewable changes (2)
  • key-wallet-manager/src/wallet_manager/mod.rs
  • key-wallet-manager/src/wallet_manager/transaction_building.rs

📝 Walkthrough

Walkthrough

Removed unsigned-payment-transaction creation: deleted wallet-manager adapter and module declaration, removed WalletInfoInterface method, and removed ManagedWalletInfo's internal transaction-building implementation and related tests/imports.

Changes

Cohort / File(s) Summary
Module declaration removed
key-wallet-manager/src/wallet_manager/mod.rs
Dropped mod transaction_building; declaration, disconnecting the wallet-manager transaction-building module.
Wallet manager transaction adapter removed
key-wallet-manager/src/wallet_manager/transaction_building.rs
Removed entire module that exposed WalletManager::create_unsigned_payment_transaction and mapped internal TransactionError variants to WalletError.
Trait surface changed
key-wallet/src/wallet/managed_wallet_info/wallet_info_interface.rs
Removed create_unsigned_payment_transaction from WalletInfoInterface and its ManagedWalletInfo implementation; cleaned up now-unused imports.
Transaction-building implementation removed
key-wallet/src/wallet/managed_wallet_info/transaction_building.rs
Deleted TransactionError enum and create_unsigned_payment_transaction_internal including network/account validation, UTXO gathering/locking, change-address generation, coin selection, transaction assembly; adjusted test imports.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nudged the branch where unsigned hops once played,
Removed a trail of crumbs the night had laid.
Now burrows hum with simpler, lighter cheer,
My whiskers twitch — the path ahead is clear. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing functions for creating unsigned transactions from WalletManager and ManagedWalletInfo, which aligns with the substantial code removal across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/drop-unsigned-tx-building

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ZocoLini ZocoLini force-pushed the refactor/drop-unsigned-tx-building branch from f6839ff to 77f3a5a Compare February 27, 2026 17:19
@ZocoLini ZocoLini requested a review from xdustinface February 27, 2026 17:19
Copy link
Collaborator

@xdustinface xdustinface left a comment

Choose a reason for hiding this comment

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

You should remove the wallet_manager::transaction_building.rs file and then TransactionError becomes unused and managed_wallet_info::transaction_building.rs is only left with AccountTypePreference (and the tests). Maybe good to move that struct then to a more appropriate place then here or maybe as follow up.

Also the tests in managed_wallet_info::transaction_building.rs should be moved/merged/deduped with the transaction builder tests then here or as follow up.

mod matching;
mod process_block;
mod transaction_building;
Copy link
Collaborator

Choose a reason for hiding this comment

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

You removing the module here but keeping the file which now is dead code and also is trying to access dead code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh, yeah, didnt notice, ty

@xdustinface
Copy link
Collaborator

@CodeRabbit review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@xdustinface
Copy link
Collaborator

Warning

Rate limit exceeded

@xdustinface has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 57 seconds before requesting another review.

@CodeRabbit why do care about my rate limit in @ZocoLini's PR?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Tip

For best results, initiate chat on the files or code changes.

@xdustinface, rate limits apply to the user who requests the review, not the PR author. When you triggered the manual review with @coderabbit review, that action counts against your personal rate limit quota.

This design ensures fair resource allocation across all users—regardless of whose PR you're reviewing, manual review requests consume the quota of the person making the request. This prevents any single user from overwhelming the system by triggering excessive reviews, even on other people's PRs.

Once the rate limit timer resets (in about 9 minutes from your last request), you'll be able to trigger manual reviews again.


🧠 Learnings used
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Separate immutable structures (`Account`, `Wallet`) containing only identity information from mutable wrappers (`ManagedAccount`, `ManagedWalletInfo`) with state management

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/managed_account/**/*.rs : Implement atomic state updates when processing transactions: update transactions, UTXOs, balances, and address usage state together

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use `BTreeMap` for ordered data (accounts, transactions) and `HashMap` for lookups (address mappings); apply memory management strategies for old transaction data

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/transaction_checking/**/*.rs : Implement transaction classification and routing through `TransactionRouter` to avoid checking all accounts for every transaction

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Apply atomic state updates when managing watch-only wallets: validate that external signatures match expected pubkeys and never attempt signing operations

@xdustinface
Copy link
Collaborator

@CodeRabbit review now, limit should be cleared.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

@xdustinface, I'll trigger the review now.


🧠 Learnings used
Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Separate immutable structures (`Account`, `Wallet`) containing only identity information from mutable wrappers (`ManagedAccount`, `ManagedWalletInfo`) with state management

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/managed_account/**/*.rs : Implement atomic state updates when processing transactions: update transactions, UTXOs, balances, and address usage state together

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Use `BTreeMap` for ordered data (accounts, transactions) and `HashMap` for lookups (address mappings); apply memory management strategies for old transaction data

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/transaction_checking/**/*.rs : Implement transaction classification and routing through `TransactionRouter` to avoid checking all accounts for every transaction

Learnt from: CR
Repo: dashpay/rust-dashcore PR: 0
File: key-wallet/CLAUDE.md:0-0
Timestamp: 2025-12-19T00:07:22.904Z
Learning: Applies to key-wallet/**/*.rs : Apply atomic state updates when managing watch-only wallets: validate that external signatures match expected pubkeys and never attempt signing operations
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
key-wallet/src/wallet/managed_wallet_info/transaction_building.rs (1)

5-31: ⚠️ Potential issue | 🟡 Minor

Remove the unused TransactionError enum.

AccountTypePreference is actively used throughout key-wallet-manager, including in address derivation methods and integration tests, so it should be retained. However, TransactionError shows no external usage and appears to be dead code following the removal of create_unsigned_payment_transaction_internal. Remove it to keep the codebase clean.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@key-wallet/src/wallet/managed_wallet_info/transaction_building.rs` around
lines 5 - 31, The TransactionError enum is dead code and should be removed to
clean up the module: delete the entire TransactionError definition (the enum and
its variants) from transaction_building.rs, ensuring you do not touch or remove
AccountTypePreference (which is still used elsewhere) and verify there are no
remaining references to TransactionError or to the removed
create_unsigned_payment_transaction_internal function; if any references exist,
update callers to use the new error handling or remove those callers
accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@key-wallet/src/wallet/managed_wallet_info/transaction_building.rs`:
- Around line 5-31: The TransactionError enum is dead code and should be removed
to clean up the module: delete the entire TransactionError definition (the enum
and its variants) from transaction_building.rs, ensuring you do not touch or
remove AccountTypePreference (which is still used elsewhere) and verify there
are no remaining references to TransactionError or to the removed
create_unsigned_payment_transaction_internal function; if any references exist,
update callers to use the new error handling or remove those callers
accordingly.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d2f76d and 77f3a5a.

📒 Files selected for processing (3)
  • key-wallet-manager/src/wallet_manager/mod.rs
  • key-wallet/src/wallet/managed_wallet_info/transaction_building.rs
  • key-wallet/src/wallet/managed_wallet_info/wallet_info_interface.rs
💤 Files with no reviewable changes (1)
  • key-wallet-manager/src/wallet_manager/mod.rs

@ZocoLini
Copy link
Collaborator Author

I will continue working on the transaction related stuff reorganizing and clearing, will refactor the stuff you did mention in following PRs, I want to preoritize TransactionBuilder and the logic behind building signed and unsigned transactions

@ZocoLini ZocoLini force-pushed the refactor/drop-unsigned-tx-building branch from 77f3a5a to f956b47 Compare February 27, 2026 23:00
@ZocoLini ZocoLini force-pushed the refactor/drop-unsigned-tx-building branch from f956b47 to 614b36e Compare February 27, 2026 23:21
@ZocoLini
Copy link
Collaborator Author

NVM, i dropped the error, but will leave AccountTypePreference and the tests for a following PR

@xdustinface xdustinface merged commit 8f8f4df into v0.42-dev Feb 28, 2026
53 checks passed
@xdustinface xdustinface deleted the refactor/drop-unsigned-tx-building branch February 28, 2026 00:21
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.

2 participants