refactor!(chain): Unify ChangeSet nomenclature#1065
refactor!(chain): Unify ChangeSet nomenclature#1065evanlinjin merged 3 commits intobitcoindevkit:masterfrom
Conversation
bad30dc to
de25407
Compare
notmandatory
left a comment
There was a problem hiding this comment.
LGTM! much easier to read using the same nomenclature across the code base. I added a couple comments/questions. I think this should go in before #1048 and then I'll rebase that PR on these changes.
|
LGTM too. I can ACK and merge after wording changes as mentioned by @notmandatory. |
|
Haven't reviewed but got a note here: #1060 (comment) that |
LLFourn
left a comment
There was a problem hiding this comment.
Approved as it is but I've made a few extra renaming suggestions and I do think now is the time to create initial_changeset methods for the tx graphs. The tx graph one could probably be implemented something like:
fn initial_changeset(&self) -> ChangeSet {
Self::default().apply_update(self.clone())
}but for IndexedTxGraph you might have to add a initial_changeset method to the Indexer trait to get it done properly.
dc55016 to
c7fff96
Compare
|
I rebased and fixed the review comments. I'm now working on adding |
|
Also, every ChangeSet is |
e8df529 to
4ac9c03
Compare
|
Ok, this took less than what I expected :) I just pushed 4ac9c03, adding |
vladimirfomene
left a comment
There was a problem hiding this comment.
Review ACK 4ac9c03. Feel free to push the TxGraph refactoring to another PR.
evanlinjin
left a comment
There was a problem hiding this comment.
ACK 4ac9c03
Looks good. My comments are regarding documentation, variable naming and minute implementation details (things that are not mission-critical and can be addressed later).
|
@danielabrozzoni looks like some small but useful suggestions so I'll wait until you've had a chance to address them before merging. |
|
ACK 4ac9c03 |
This commit renames: - indexed_tx_graph::IndexedAdditions -> indexed_tx_graph::ChangeSet - indexed_tx_graph::IndexedAdditions::graph_additions -> indexed_tx_graph::ChangeSet::graph - indexed_tx_graph::IndexedAdditions::index_additions -> indexed_tx_graph::ChangeSet::indexer - tx_graph::Additions -> tx_graph::ChangeSet - keychain::DerivationAdditions -> keychain::ChangeSet - CanonicalTx::node -> CanonicalTx::tx_node - CanonicalTx::observed_as -> CanonicalTx::chain_position - LocalChangeSet -> WalletChangeSet - LocalChangeSet::chain_changeset -> WalletChangeSet::chain - LocalChangeSet::indexed_additions -> WalletChangeSet::indexed_tx_graph - LocalUpdate -> WalletUpdate This commit also changes the visibility of TxGraph::determine_changeset to be pub(crate), and the method accepts a TxGraph instead of &TxGraph This commit removes: - `TxGraph::insert_txout_preview` - `TxGraph::insert_tx_preview` - `insert_anchor_preview` - `insert_seen_at_preview` Solves bitcoindevkit#1022
Add `initial_changeset` to TxGraph and IndexedTxGraph
4ac9c03 to
80f5ecf
Compare
|
Thanks for the reviews! Updated, and pushed a commit on top to fix the CI |
Solves #1022
Changelog notice
Rename
indexed_tx_graph::IndexedAdditionstoindexed_tx_graph::ChangeSetRename
indexed_tx_graph::IndexedAdditions::graph_additionstoindexed_tx_graph::ChangeSet::graphRename
indexed_tx_graph::IndexedAdditions::index_additionstoindexed_tx_graph::ChangeSet::indexerRename
tx_graph::Additionstotx_graph::ChangeSetRename
keychain::DerivationAdditionstokeychain::ChangeSetRename
CanonicalTx::nodetoCanonicalTx::tx_nodeRename
CanonicalTx::observed_astoCanonicalTx::chain_positionRename
LocalChangeSettoWalletChangeSetRename
LocalChangeSet::chain_changesettoWalletChangeSet::chainRename
LocalChangeSet::indexed_additionstoWalletChangeSet::indexed_tx_graphRename
LocalUpdatetoWalletUpdateMake
TxGraph::determine_changesetpub(crate)Add
TxGraph::initial_changesetAdd
IndexedTxGraph::initial_changesetRemove
TxGraph::insert_txout_previewRemove
TxGraph::insert_tx_previewRemove
insert_anchor_previewRemove
insert_seen_at_previewNotes to reviewers
I'm not sure whether we want to keep
TxGraph::determine_changesetpublic or notChecklists
All Submissions:
cargo fmtandcargo clippybefore committing