Cleanup - WIP
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package peer
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"testing"
|
||||
@@ -11,25 +12,27 @@ import (
|
||||
func TestNetworkState_RoundTrip(t *testing.T) {
|
||||
path := filepath.Join(t.TempDir(), "network.json")
|
||||
|
||||
var sign1 [32]byte
|
||||
copy(sign1[:], []byte("0123456789abcdef0123456789abcdef"))
|
||||
|
||||
state := m.NetworkState{Peers: []m.Peer{
|
||||
{
|
||||
PeerIP: 1,
|
||||
Version: 7,
|
||||
Name: "hub",
|
||||
Addr4: []byte{10, 11, 12, 1},
|
||||
Addr4: netip.MustParseAddr("10.11.12.1"),
|
||||
Port: 51820,
|
||||
Relay: true,
|
||||
WGPubKey: make([]byte, 32),
|
||||
SignPubKey: make([]byte, 32),
|
||||
WGPubKey: mustKey(t),
|
||||
SignPubKey: sign1,
|
||||
},
|
||||
{
|
||||
PeerIP: 10,
|
||||
Version: 3,
|
||||
Name: "laptop",
|
||||
Addr4: []byte{10, 11, 12, 10},
|
||||
Port: 51820,
|
||||
WGPubKey: []byte("0123456789abcdef0123456789abcdef"),
|
||||
SignPubKey: []byte("fedcba9876543210fedcba9876543210"),
|
||||
PeerIP: 10,
|
||||
Version: 3,
|
||||
Name: "laptop",
|
||||
Addr4: netip.MustParseAddr("10.11.12.10"),
|
||||
Port: 51820,
|
||||
WGPubKey: mustKey(t),
|
||||
},
|
||||
}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user