Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #371 +/- ##
==========================================
+ Coverage 59.08% 61.05% +1.97%
==========================================
Files 25 26 +1
Lines 4646 4894 +248
==========================================
+ Hits 2745 2988 +243
- Misses 1901 1906 +5
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
Adds BIP-329 wallet labels to
bdk-cli, using the standalonebdk-labelscrate as suggested by @notmandatory in PR #266. Fixes #184 . Supersedes #266, which I'll close very soon, as it no longer applies after the refactor.label: attach a label to a transaction, a UTXO, or an address, with exactly one of--txid,--utxo,--address, and--text.import_labels <file>with--strategy keep-existing|overwrite(defaultkeep-existing), andexport_labels <file>.transactions,unspentandunused_addressshow alabelfield, left out when there is none.<datadir>/<wallet>/labels.jsonl, owner-only, independent of the sqlite/redb wallet database.Labels are loaded only by the commands that use them, never in
OfflineOperations, which only gainswallet_name(mirroringOnlineOperations).Notes to the reviewers
This answers the five points in @vadim-anfv's review of PR #266:
—placeholder: gone. Unlabeled items have nolabelfield, so a real—label is distinguishable (a_dash_label_is_told_apart_from_no_label).spendable: labelling a UTXO never changes it, and a coin frozen elsewhere stays frozen on a rename (labelling_a_utxo_keeps_it_spendable_or_frozen_as_it_was). It is stored and exported but not tied tolock_utxo;.unused_addressshows the address label (unused_address_shows_its_label).labels_can_be_set_in_the_repl,labels_are_shown_in_the_repl).labels.jsonlbreaking every command:balancenever reads the file. Display commands warn and carry on.label,import_labelsandexport_labelsfail naming the file.Other behavior worth a look:
require_network, notparse_address.a_bad_import_file_changes_nothing).Testing:
bitcoindwith therpcbackend: funded a wallet, synced, and labelled a transaction and a UTXO.transactionsandunspentshowed the labels (also in the REPL),lock_utxoleft the label untouched, and renaming a coin withspendable:falsekept itfalse.just pre-pushChecklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: