diff options
author | Sonic <sonic@cobinhood.com> | 2018-10-15 11:31:40 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:23:39 +0800 |
commit | 7d27d334ed128bf528c8a7fc16674d0a29481087 (patch) | |
tree | c32e491a0b8b722788ef801e873dabf0256f9058 /dex/peer_test.go | |
parent | f4d15de52885a472ffb4ae5982662ec3f41ebebc (diff) | |
download | go-tangerine-7d27d334ed128bf528c8a7fc16674d0a29481087.tar.gz go-tangerine-7d27d334ed128bf528c8a7fc16674d0a29481087.tar.zst go-tangerine-7d27d334ed128bf528c8a7fc16674d0a29481087.zip |
dex: add self node meta after Start
Diffstat (limited to 'dex/peer_test.go')
-rw-r--r-- | dex/peer_test.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/dex/peer_test.go b/dex/peer_test.go index d0262e201..74989258a 100644 --- a/dex/peer_test.go +++ b/dex/peer_test.go @@ -6,13 +6,18 @@ import ( "testing" mapset "github.com/deckarep/golang-set" + "github.com/dexon-foundation/dexon/crypto" "github.com/dexon-foundation/dexon/p2p/discover" "github.com/dexon-foundation/dexon/p2p/enode" ) func TestPeerSetBuildAndForgetNotaryConn(t *testing.T) { self := discover.Node{ID: nodeID(0)} - server := newTestP2PServer(&self) + key, err := crypto.GenerateKey() + if err != nil { + t.Fatal(err) + } + server := newTestP2PServer(&self, key) table := newNodeTable() gov := &testGovernance{ @@ -49,7 +54,6 @@ func TestPeerSetBuildAndForgetNotaryConn(t *testing.T) { ps := newPeerSet(gov, server, table) peer1 := newDummyPeer(nodeID(1)) peer2 := newDummyPeer(nodeID(2)) - var err error err = ps.Register(peer1) if err != nil { t.Error(err) @@ -312,7 +316,11 @@ func TestPeerSetBuildAndForgetNotaryConn(t *testing.T) { func TestPeerSetBuildDKGConn(t *testing.T) { self := discover.Node{ID: nodeID(0)} - server := newTestP2PServer(&self) + key, err := crypto.GenerateKey() + if err != nil { + t.Fatal(err) + } + server := newTestP2PServer(&self, key) table := newNodeTable() gov := &testGovernance{} @@ -329,7 +337,6 @@ func TestPeerSetBuildDKGConn(t *testing.T) { ps := newPeerSet(gov, server, table) peer1 := newDummyPeer(nodeID(1)) peer2 := newDummyPeer(nodeID(2)) - var err error err = ps.Register(peer1) if err != nil { t.Error(err) |