diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-27 20:47:32 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-15 22:09:55 +0800 |
commit | 8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47 (patch) | |
tree | ab7aed4bb7d580011469dda917483e785c234a32 /dex/peer_test.go | |
parent | c52c9e04a916fac3550b0a3c3d8cdf979ab70bb8 (diff) | |
download | go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar.gz go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar.bz2 go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar.lz go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar.xz go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.tar.zst go-tangerine-8732c918f7b5d3dd9ac45b6e00995f5d74bc8a47.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") |