-
Notifications
You must be signed in to change notification settings - Fork 329
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
Simplify Esplora::update_local_chain
and add tests
#1267
Conversation
e84e26f
to
b7c8d18
Compare
Esplora::update_local_chain
and add tests.
810e9c7
to
6fd083e
Compare
@notmandatory this doesn't really change the API |
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.
Concept ACK. One thing looks like it needs to be updated.
6fd083e
to
6f824cf
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.
I found some more things that could be simplified as part of this.
1f17260
to
63fa710
Compare
Esplora::update_local_chain
and add tests.Esplora::update_local_chain
and add tests
self-ACK: 216648b Pushed a comment and docs better explaining what @evanlinjin was trying to explain to me here: #1267 (comment) |
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.
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.
A few nits, otherwise LGTM
}) | ||
}; | ||
|
||
// We have found point of agreement so the update will connect! |
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.
What if no point of agreement is found? Is this possible?
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.
This should never happen because the genesis block must connect! However, let's say hypothetically, the genesis doesn't connect (because the wallet and esplora are on different networks), the update formed will try replace the genesis, resulting in the local_chain::MissingGenesisError
which is the error that we want!
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.
Found a couple typos that should be fixed.
c122434
to
929b5dd
Compare
To fix CI in
with:
|
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 c5afbaa
Thank you @notmandatory for spotting the typos and fixing 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.
utACK c5afbaa
Fixes #1199
Description
After a second look at the
update_local_chain
implementations, it was clear that they were over complicated. This PR simplifies theEsploraExt::update_local_chain
method(s) of thebdk_esplora
crate and adds a whole bunch of tests.Notes to the reviewers
The description of #1199 is very brief, however @danielabrozzoni mentioned about potentially-problematic logic with
ASSUME_FINAL_DEPTH
. The logic was indeed convoluted and it did not need to be that way. This PR removes the need forASSUME_FINAL_DEPTH
.Changelog notice
Fixed
EsploraExt::update_local_chain
logic.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingBugfixes:
* [ ] This pull request breaks the existing API* [ ] I've added tests to reproduce the issue which are now passing(there are now lots of tests though)