-
Notifications
You must be signed in to change notification settings - Fork 2.2k
lnwallet: add reorg test #232
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
Conversation
@aakselrod, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Roasbeef, @tmc and @bryanvu to be potential reviewers. |
Once this is rebased, it'll be able to build against the latest version of master which has the dependent changes of |
1882407
to
ca2f81b
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.
Excellent test addition! This should serve as a guard against future regressions within the btcwallet
implementation of the WalletController
, and also to ensure that any other future WalletController
implementations properly handle large repeated re-orgs.
My comments are pretty minor, so once this is rebased to the latest master, we should be able to get it merged quickly.
lnwallet/interface_test.go
Outdated
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.
Minor nit: missing a new line above here, and also below the call to Generate
. There're a few other instances of this within this PR. However, to avoid notification spam, I'll only comment once.
lnwallet/interface_test.go
Outdated
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.
Minor nit: missing a new line above here. And also below the call to Generate
.
lnwallet/interface_test.go
Outdated
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.
With the latest change to the way the these tests are run, this logging statement is no longer needed. When you rebase to master, you'll instead tag a name onto this test case at the bottom of this file.
lnwallet/interface_test.go
Outdated
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.
Rather than a hard coded sleep here (which may have weird issues when running on Travis), we can instead use the IsSynced
method on the WalletController
interface. The same swap can be repeated several times in this test case.
lnwallet/interface_test.go
Outdated
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.
Left over from debugging?
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.
Yes, good catch. Thanks! Removing now.
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 🎉
This PR adds a new test to make sure reorganizations work correctly.