mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 08:02:25 +02:00
lnwire: remove not working test
Validation of the announcements message has been removed and it will be added in the discovery package latter.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
4c52b6e6a4
commit
c174141a72
@@ -4,9 +4,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/roasbeef/btcd/btcec"
|
|
||||||
"github.com/roasbeef/btcd/chaincfg/chainhash"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNodeAnnouncementEncodeDecode(t *testing.T) {
|
func TestNodeAnnouncementEncodeDecode(t *testing.T) {
|
||||||
@@ -44,35 +41,7 @@ func TestNodeAnnouncementEncodeDecode(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNodeAnnouncementValidation(t *testing.T) {
|
func TestNodeAnnoucementPayloadLength(t *testing.T) {
|
||||||
getKeys := func(s string) (*btcec.PrivateKey, *btcec.PublicKey) {
|
|
||||||
return btcec.PrivKeyFromBytes(btcec.S256(), []byte(s))
|
|
||||||
}
|
|
||||||
|
|
||||||
nodePrivKey, nodePubKey := getKeys("node-id-1")
|
|
||||||
|
|
||||||
var hash []byte
|
|
||||||
na := &NodeAnnouncement{
|
|
||||||
Timestamp: maxUint32,
|
|
||||||
Addresses: someAddresses,
|
|
||||||
NodeID: nodePubKey,
|
|
||||||
RGBColor: someRGB,
|
|
||||||
Alias: someAlias,
|
|
||||||
Features: someFeatures,
|
|
||||||
}
|
|
||||||
|
|
||||||
dataToSign, _ := na.DataToSign()
|
|
||||||
hash = chainhash.DoubleHashB(dataToSign)
|
|
||||||
|
|
||||||
signature, _ := nodePrivKey.Sign(hash)
|
|
||||||
na.Signature = signature
|
|
||||||
|
|
||||||
if err := na.Validate(); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestNodeAnnouncementPayloadLength(t *testing.T) {
|
|
||||||
na := &NodeAnnouncement{
|
na := &NodeAnnouncement{
|
||||||
Signature: someSig,
|
Signature: someSig,
|
||||||
Timestamp: maxUint32,
|
Timestamp: maxUint32,
|
||||||
|
Reference in New Issue
Block a user