From 0e242bae825afa4a7834401d55c3ce6ed3702922 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 8 Mar 2022 17:47:31 +0800 Subject: [PATCH] netann: create testSigBytes for unit test --- netann/chan_status_manager_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/netann/chan_status_manager_test.go b/netann/chan_status_manager_test.go index 4e8d97281..19ada7ba6 100644 --- a/netann/chan_status_manager_test.go +++ b/netann/chan_status_manager_test.go @@ -21,6 +21,11 @@ import ( var ( testKeyLoc = keychain.KeyLocator{Family: keychain.KeyFamilyNodeKey} + + // testSigBytes specifies a testing signature with the minimal length. + testSigBytes = []byte{ + 0x30, 0x06, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, + } ) // randOutpoint creates a random wire.Outpoint. @@ -105,13 +110,13 @@ func createEdgePolicies(t *testing.T, channel *channeldb.OpenChannel, ChannelID: channel.ShortChanID().ToUint64(), ChannelFlags: dir1, LastUpdate: time.Now(), - SigBytes: make([]byte, 64), + SigBytes: testSigBytes, }, &channeldb.ChannelEdgePolicy{ ChannelID: channel.ShortChanID().ToUint64(), ChannelFlags: dir2, LastUpdate: time.Now(), - SigBytes: make([]byte, 64), + SigBytes: testSigBytes, } } @@ -209,7 +214,7 @@ func (g *mockGraph) ApplyChannelUpdate(update *lnwire.ChannelUpdate) error { ChannelID: update.ShortChannelID.ToUint64(), ChannelFlags: update.ChannelFlags, LastUpdate: timestamp, - SigBytes: make([]byte, 64), + SigBytes: testSigBytes, } if update1 {