diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-27 20:47:32 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:59 +0800 |
commit | 0c63646ca8b06bb527737cd6e2a7fe58f169efff (patch) | |
tree | b0666613c2a3cb84d53b60597bfef5ec45548c3a /dex/peer_test.go | |
parent | 91981becf98b988470810aa1c26d86de2d294e29 (diff) | |
download | dexon-0c63646ca8b06bb527737cd6e2a7fe58f169efff.tar dexon-0c63646ca8b06bb527737cd6e2a7fe58f169efff.tar.gz dexon-0c63646ca8b06bb527737cd6e2a7fe58f169efff.tar.bz2 dexon-0c63646ca8b06bb527737cd6e2a7fe58f169efff.tar.lz dexon-0c63646ca8b06bb527737cd6e2a7fe58f169efff.tar.xz dexon-0c63646ca8b06bb527737cd6e2a7fe58f169efff.tar.zst dexon-0c63646ca8b06bb527737cd6e2a7fe58f169efff.zip |
core: merge notarySet and DKGSet (#265)
* vendor: sync to latest core
* core: merge notarySet and dkgSet
* dex: optimize network traffic for finalized block
Diffstat (limited to 'dex/peer_test.go')
-rw-r--r-- | dex/peer_test.go | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/dex/peer_test.go b/dex/peer_test.go index 76a28b1ef..d6bc7e24c 100644 --- a/dex/peer_test.go +++ b/dex/peer_test.go @@ -62,31 +62,16 @@ func TestPeerSetBuildAndForgetConn(t *testing.T) { nodes[1].ID().String(): nodes[1], nodes[2].ID().String(): nodes[2], }, - {set: dkgset, round: 10}: { - self.ID().String(): self, - nodes[1].ID().String(): nodes[1], - nodes[3].ID().String(): nodes[3], - }, {set: notaryset, round: 11}: { self.ID().String(): self, nodes[1].ID().String(): nodes[1], nodes[5].ID().String(): nodes[5], }, - {set: dkgset, round: 11}: { - nodes[1].ID().String(): nodes[1], - nodes[2].ID().String(): nodes[2], - nodes[5].ID().String(): nodes[5], - }, {set: notaryset, round: 12}: { self.ID().String(): self, nodes[3].ID().String(): nodes[3], nodes[5].ID().String(): nodes[5], }, - {set: dkgset, round: 12}: { - self.ID().String(): self, - nodes[3].ID().String(): nodes[3], - nodes[5].ID().String(): nodes[5], - }, } if !reflect.DeepEqual(ps.label2Nodes, expectedlabel2Nodes) { @@ -97,28 +82,12 @@ func TestPeerSetBuildAndForgetConn(t *testing.T) { {set: notaryset, round: 10}: {}, {set: notaryset, round: 11}: {}, {set: notaryset, round: 12}: {}, - {set: dkgset, round: 10}: {}, - {set: dkgset, round: 12}: {}, } if !reflect.DeepEqual(ps.directConn, expectedDirectConn) { t.Errorf("direct conn not match") } - expectedGroupConn := []peerLabel{ - {set: dkgset, round: 11}, - } - - if len(ps.groupConnPeers) != len(expectedGroupConn) { - t.Errorf("group conn peers not match") - } - - for _, l := range expectedGroupConn { - if len(ps.groupConnPeers[l]) == 0 { - t.Errorf("group conn peers is 0") - } - } - expectedAllDirect := make(map[string]map[peerLabel]struct{}) for l := range ps.directConn { @@ -152,11 +121,6 @@ func TestPeerSetBuildAndForgetConn(t *testing.T) { nodes[3].ID().String(): nodes[3], nodes[5].ID().String(): nodes[5], }, - {set: dkgset, round: 12}: { - self.ID().String(): self, - nodes[3].ID().String(): nodes[3], - nodes[5].ID().String(): nodes[5], - }, } if !reflect.DeepEqual(ps.label2Nodes, expectedlabel2Nodes) { @@ -165,14 +129,13 @@ func TestPeerSetBuildAndForgetConn(t *testing.T) { expectedDirectConn = map[peerLabel]struct{}{ {set: notaryset, round: 12}: {}, - {set: dkgset, round: 12}: {}, } if !reflect.DeepEqual(ps.directConn, expectedDirectConn) { t.Error("direct conn not match") } - expectedGroupConn = []peerLabel{} + expectedGroupConn := []peerLabel{} if len(ps.groupConnPeers) != len(expectedGroupConn) { t.Errorf("group conn peers not match") |