lnwallet: add funding amount assertion to tests
In this commit, an assertion is added to the bolt 3 commitment tx tests that ensures that the local and remote balances add up to the expected funding amount. Adding this assertion uncovered a borked test vector which is also fixed in this commit.
This commit is contained in:
2 files changed
+8
-3
No files matched your search
@@ -270,6 +270,11 @@ func testVectors(t *testing.T, chanType channeldb.ChannelType, test testCase) {
|
||||
}
|
||||
}
|
||||
|
||||
// Assert that the remote and local balances add up to the channel
|
||||
// capacity.
|
||||
require.EqualValues(t, lnwire.NewMSatFromSatoshis(tc.fundingAmount),
|
||||
remoteBalance+localBalance)
|
||||
|
||||
// Set up a test channel on which the test commitment transaction is
|
||||
// going to be produced.
|
||||
remoteChannel, localChannel := createTestChannelsForVectors(
|
||||
|
||||
Reference in new issue
Block a user