lnwallet: lint bolt 3 test vectors func

This commit is contained in:
Elle Mouton 2023-02-22 09:47:37 +02:00
parent 15da50df10
commit 09ff853b9c
No known key found for this signature in database
GPG key ID: D7D916376026F177

View file

@ -304,10 +304,12 @@ func testVectors(t *testing.T, chanType channeldb.ChannelType, test testCase) {
remoteSig, remoteHtlcSigs, _, err := remoteChannel.SignNextCommitment()
require.NoError(t, err)
require.Equal(t, test.RemoteSigHex, hex.EncodeToString(remoteSig.ToSignatureBytes()))
require.Equal(t, test.RemoteSigHex,
hex.EncodeToString(remoteSig.ToSignatureBytes()))
for i, sig := range remoteHtlcSigs {
require.Equal(t, test.HtlcDescs[i].RemoteSigHex, hex.EncodeToString(sig.ToSignatureBytes()))
require.Equal(t, test.HtlcDescs[i].RemoteSigHex,
hex.EncodeToString(sig.ToSignatureBytes()))
}
err = localChannel.ReceiveNewCommitment(remoteSig, remoteHtlcSigs)
@ -325,7 +327,8 @@ func testVectors(t *testing.T, chanType channeldb.ChannelType, test testCase) {
var txBytes bytes.Buffer
require.NoError(t, forceCloseSum.CloseTx.Serialize(&txBytes))
require.Equal(t, test.ExpectedCommitmentTxHex, hex.EncodeToString(txBytes.Bytes()))
require.Equal(t, test.ExpectedCommitmentTxHex,
hex.EncodeToString(txBytes.Bytes()))
// Obtain the second level transactions that the local node's channel
// state machine has produced. Store them in a map indexed by commit tx