Repository navigation
Conversation
`WalletConfigInner` duplicated its own wallet name in a `wallet` field, even though it's already the key in `WalletConfig::wallets` - this showed up as a redundant `"wallet"` entry in `wallets` output. `TryFrom<&WalletConfigInner> for WalletOpts` relied on that field, so it's replaced with a private `try_to_wallet_opts(&self, wallet_name: &str)` that takes the name from the caller's map lookup instead. Old config.toml files still load fine; serde ignores the now-unknown `wallet` key. Fixes bitcoindevkit#332
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #350 +/- ##
==========================================
+ Coverage 61.43% 61.54% +0.11%
==========================================
Files 23 23
Lines 3993 4005 +12
==========================================
+ Hits 2453 2465 +12
Misses 1540 1540
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Description
Removes the redundant
walletfield fromWalletConfigInner. The wallet name was being stored twice: once as the key inWalletConfig::wallets, and once inside each entry aswallet: String. Thewalletscommand's JSON/TOML output showed both.For example:
{
"my_wallet": {
"wallet": "my_wallet",
"network": "testnet",
...
}
}
The
"wallet"field inside the entry is gone and the name is still available as the map key.Fixes #332
Notes to the reviewers
TryFrom<&WalletConfigInner> for WalletOptsneeded to be removed because it only receives the struct. It is now replaced with a privatetry_to_wallet_opts(&self, wallet_name: &str)that takes the name from the caller instead.Backward compatible: old config.toml files with the stray
wallet = "..."line still load (serde ignores unknown fields). This is covered bytest_load_tolerates_legacy_wallet_field.CHANGELOG updated under
[Unreleased].Checklists
All Submissions:
cargo fmtandcargo clippybefore committing