mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-07 13:39:46 +02:00
lnwallet: lint bolt 3 test vectors func
This commit is contained in:
parent
15da50df10
commit
09ff853b9c
@ -304,10 +304,12 @@ func testVectors(t *testing.T, chanType channeldb.ChannelType, test testCase) {
|
|||||||
remoteSig, remoteHtlcSigs, _, err := remoteChannel.SignNextCommitment()
|
remoteSig, remoteHtlcSigs, _, err := remoteChannel.SignNextCommitment()
|
||||||
require.NoError(t, err)
|
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 {
|
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)
|
err = localChannel.ReceiveNewCommitment(remoteSig, remoteHtlcSigs)
|
||||||
@ -325,7 +327,8 @@ func testVectors(t *testing.T, chanType channeldb.ChannelType, test testCase) {
|
|||||||
var txBytes bytes.Buffer
|
var txBytes bytes.Buffer
|
||||||
require.NoError(t, forceCloseSum.CloseTx.Serialize(&txBytes))
|
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
|
// Obtain the second level transactions that the local node's channel
|
||||||
// state machine has produced. Store them in a map indexed by commit tx
|
// state machine has produced. Store them in a map indexed by commit tx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user