netann: create testSigBytes for unit test
This commit is contained in:
1 file changed
+8
-3
@@ -21,6 +21,11 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
testKeyLoc = keychain.KeyLocator{Family: keychain.KeyFamilyNodeKey}
|
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.
|
// randOutpoint creates a random wire.Outpoint.
|
||||||
@@ -105,13 +110,13 @@ func createEdgePolicies(t *testing.T, channel *channeldb.OpenChannel,
|
|||||||
ChannelID: channel.ShortChanID().ToUint64(),
|
ChannelID: channel.ShortChanID().ToUint64(),
|
||||||
ChannelFlags: dir1,
|
ChannelFlags: dir1,
|
||||||
LastUpdate: time.Now(),
|
LastUpdate: time.Now(),
|
||||||
SigBytes: make([]byte, 64),
|
SigBytes: testSigBytes,
|
||||||
},
|
},
|
||||||
&channeldb.ChannelEdgePolicy{
|
&channeldb.ChannelEdgePolicy{
|
||||||
ChannelID: channel.ShortChanID().ToUint64(),
|
ChannelID: channel.ShortChanID().ToUint64(),
|
||||||
ChannelFlags: dir2,
|
ChannelFlags: dir2,
|
||||||
LastUpdate: time.Now(),
|
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(),
|
ChannelID: update.ShortChannelID.ToUint64(),
|
||||||
ChannelFlags: update.ChannelFlags,
|
ChannelFlags: update.ChannelFlags,
|
||||||
LastUpdate: timestamp,
|
LastUpdate: timestamp,
|
||||||
SigBytes: make([]byte, 64),
|
SigBytes: testSigBytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
if update1 {
|
if update1 {
|
||||||
|
|||||||
Reference in new issue
Block a user