-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!(chain): Unify ChangeSet nomenclature #1065
Conversation
bad30dc
to
de25407
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. ACK 4ac9c03
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review ACK 4ac9c03. Feel free to push the TxGraph refactoring to another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 62f2531
Solves #1022
Changelog notice
Rename
indexed_tx_graph::IndexedAdditions
toindexed_tx_graph::ChangeSet
Rename
indexed_tx_graph::IndexedAdditions::graph_additions
toindexed_tx_graph::ChangeSet::graph
Rename
indexed_tx_graph::IndexedAdditions::index_additions
toindexed_tx_graph::ChangeSet::indexer
Rename
tx_graph::Additions
totx_graph::ChangeSet
Rename
keychain::DerivationAdditions
tokeychain::ChangeSet
Rename
CanonicalTx::node
toCanonicalTx::tx_node
Rename
CanonicalTx::observed_as
toCanonicalTx::chain_position
Rename
LocalChangeSet
toWalletChangeSet
Rename
LocalChangeSet::chain_changeset
toWalletChangeSet::chain
Rename
LocalChangeSet::indexed_additions
toWalletChangeSet::indexed_tx_graph
Rename
LocalUpdate
toWalletUpdate
Make
TxGraph::determine_changeset
pub(crate)
Add
TxGraph::initial_changeset
Add
IndexedTxGraph::initial_changeset
Remove
TxGraph::insert_txout_preview
Remove
TxGraph::insert_tx_preview
Remove
insert_anchor_preview
Remove
insert_seen_at_preview
Notes to reviewers
I'm not sure whether we want to keep
TxGraph::determine_changeset
public or notChecklists
All Submissions:
cargo fmt
andcargo clippy
before committing