-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Move network harness into lntest package #425
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
c34c478
to
ae9b60f
Compare
ae9b60f
to
4d1534b
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 dig the refactor! After this, the package can now be re-used in other projects which need to script the interaction of lnd
nodes. Most of my comments a pretty minor, the notable ones are: we now manually the the number of confirmations for a transaction, and about restoring the prior OnTxAccepted
callback.
lnd_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.
Odd line wrapping here. Not replicated in the existing codebase.
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.
How would you format this declaration to not violate the 80 char limit?
lnd_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.
Sending over a raw channel here which is then passed into the lnd
harness seems like a step backwards. We can still re-use the same callback method added as we'll still start the btcd harness before we start the lnd harness.
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.
Reworked this.
lntest/doc.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.
👍
lntest/harness.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.
Missing a godoc
comment.
lntest/harness.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.
Comment should be updated, this no longer takes the extra command line flags directly.
lntest/harness.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.
godoc
comment should document the semantics of lndArgs
. Based on my earlier comment, I don't think the seenTxns
arg is needed at all.
lntest/node.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.
Note that in master, we now manually set defaultnumconfs
.
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.
Rebased.
lntest/node.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.
Missing godoc
comment.
lnd_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.
This commit is out of order FWIW (it wouldn't compile by itself).
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 think GitHub just orders the commits weird (by date instead of actually in order). The dates are screwed up because I had to cherry-pick a bunch from another branch.
This creates a new nodeConfig struct for the node in the lntest package in order to decouple lntest from the main package.
This is preferable to calling Shutdown on the node directly so that the harness manages the entire lifecycle of an lnd process.
1f30c11
to
20ee9d8
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 💎
Creates an lntest package for testing utilities. For now it just has the NetworkHarness and HarnessNode structs. Some minor refactors to the harness as well.