mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01: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:
parent
4c52b6e6a4
commit
c174141a72
@ -4,9 +4,6 @@ import (
|
||||
"bytes"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/roasbeef/btcd/btcec"
|
||||
"github.com/roasbeef/btcd/chaincfg/chainhash"
|
||||
)
|
||||
|
||||
func TestNodeAnnouncementEncodeDecode(t *testing.T) {
|
||||
@ -44,35 +41,7 @@ func TestNodeAnnouncementEncodeDecode(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeAnnouncementValidation(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) {
|
||||
func TestNodeAnnoucementPayloadLength(t *testing.T) {
|
||||
na := &NodeAnnouncement{
|
||||
Signature: someSig,
|
||||
Timestamp: maxUint32,
|
||||
|
Loading…
Reference in New Issue
Block a user