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:
Elle Mouton committed 2023-03-16 17:27:04 +02:00
1 parent 09ff853b9c
commit dbc19b24e5
2 files changed
+8 -3

No files matched your search

+5
View File
@@ -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(