Skip to content

feat(key-wallet): add downgrade_to_external_signable method to wallets - #782

Merged
QuantumExplorer merged 1 commit into
devfrom
feat/wallet-downgrade
May 22, 2026
Merged

feat(key-wallet): add downgrade_to_external_signable method to wallets#782
QuantumExplorer merged 1 commit into
devfrom
feat/wallet-downgrade

Conversation

@ZocoLini

@ZocoLiniZocoLini commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

New Features

  • Wallets can now transition to external signing mode, enabling flexible wallet management configurations for users requiring alternative signing mechanisms.

Review Change Stack

@coderabbitai

coderabbitaiBot commented May 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR adds a new public method downgrade_to_external_signable() to the Wallet type, allowing wallets to transition into external signing mode by mutating their wallet type to the ExternalSignable variant.

Changes

Wallet External Signable Downgrade

Layer / File(s)Summary
New downgrade_to_external_signable method
key-wallet/src/wallet/mod.rs
A new public method accepts a mutable wallet reference and sets self.wallet_type to WalletType::ExternalSignable.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A wallet takes a downward hop,
From inner signing—it won't stop!
External mode is here to stay,
One tiny method lights the way. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately describes the main change: adding a new method downgrade_to_external_signable to the Wallet type in the key-wallet crate.
Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/wallet-downgrade

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.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@key-wallet/src/wallet/mod.rs`:
- Around line 129-131: Add a unit test that constructs a Wallet (use the same
constructor used in tests) initialized to a non-external-signable type, calls
wallet.downgrade_to_external_signable(), then asserts the wallet.wallet_type
flipped to WalletType::ExternalSignable and that wallet.is_external_signable()
returns true while wallet.can_sign() returns false (or the expected downstream
behavior). Put the test in the same module tests block (or #[cfg(test)] mod
tests) alongside other wallet tests and name it e.g.
test_downgrade_to_external_signable to clearly cover the new API.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 394430c4-7a12-4aa7-9a43-8d055df263a4

📥 Commits

Reviewing files that changed from the base of the PR and between f569e7b and a4b3774.

📒 Files selected for processing (1)
  • key-wallet/src/wallet/mod.rs

Comment threadkey-wallet/src/wallet/mod.rs
@codecov

codecovBot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.26%. Comparing base (f569e7b) to head (a4b3774).

Files with missing linesPatch %Lines
key-wallet/src/wallet/mod.rs0.00%3 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## dev #782 +/- ##
==========================================
+ Coverage 72.17% 72.26% +0.09% 
==========================================
Files 321 321 Lines 70367 70370 +3 ==========================================
+ Hits 50790 50856 +66 + Misses 19577 19514 -63 
FlagCoverage Δ
core76.30% <ø> (ø)
ffi45.91% <ø> (+0.31%)⬆️
rpc20.00% <ø> (ø)
spv89.99% <ø> (+0.22%)⬆️
wallet71.21% <0.00%> (-0.02%)⬇️
Files with missing linesCoverage Δ
key-wallet/src/wallet/mod.rs93.91% <0.00%> (-1.09%)⬇️

... and 20 files with indirect coverage changes

@QuantumExplorer
QuantumExplorer merged commit 7abc02e into devMay 22, 2026
45 checks passed
@QuantumExplorer
QuantumExplorer deleted the feat/wallet-downgrade branch May 22, 2026 19:47
Sign up for freeto 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

@ZocoLini@QuantumExplorer