aboutsummaryrefslogtreecommitdiffstats
path: root/dex/helper_test.go
diff options
context:
space:
mode:
authorSonic <sonic@cobinhood.com>2018-10-14 22:39:11 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit47f5134d1d45538b95dfc45913a83bab594d3ca5 (patch)
treec49a0ede8b012cb6c9fed2a7d34dc49b229adc28 /dex/helper_test.go
parentb0c906ba404b55147b5e3a085b6a4c3906524a1d (diff)
downloaddexon-47f5134d1d45538b95dfc45913a83bab594d3ca5.tar
dexon-47f5134d1d45538b95dfc45913a83bab594d3ca5.tar.gz
dexon-47f5134d1d45538b95dfc45913a83bab594d3ca5.tar.bz2
dexon-47f5134d1d45538b95dfc45913a83bab594d3ca5.tar.lz
dexon-47f5134d1d45538b95dfc45913a83bab594d3ca5.tar.xz
dexon-47f5134d1d45538b95dfc45913a83bab594d3ca5.tar.zst
dexon-47f5134d1d45538b95dfc45913a83bab594d3ca5.zip
dex: add method to get NumChains, NotarySet, DKGSet easily
Diffstat (limited to 'dex/helper_test.go')
-rw-r--r--dex/helper_test.go22
1 files changed, 9 insertions, 13 deletions
diff --git a/dex/helper_test.go b/dex/helper_test.go
index fc8053774..21803ed88 100644
--- a/dex/helper_test.go
+++ b/dex/helper_test.go
@@ -182,25 +182,21 @@ func newTestTransaction(from *ecdsa.PrivateKey, nonce uint64, datasize int) *typ
// testGovernance is a fake, helper governance for testing purposes
type testGovernance struct {
- getChainNumFunc func(uint64) uint32
- getNotarySetFunc func(uint32, uint64) map[string]struct{}
- getDKGSetFunc func(uint64) map[string]struct{}
+ numChainsFunc func(uint64) uint32
+ notarySetFunc func(uint32, uint64) map[string]struct{}
+ dkgSetFunc func(uint64) map[string]struct{}
}
-func (g *testGovernance) GetChainNum(round uint64) uint32 {
- return g.getChainNumFunc(round)
+func (g *testGovernance) GetNumChains(round uint64) uint32 {
+ return g.numChainsFunc(round)
}
-func (g *testGovernance) GetNotarySet(chainID uint32, round uint64) map[string]struct{} {
- return g.getNotarySetFunc(chainID, round)
+func (g *testGovernance) NotarySet(chainID uint32, round uint64) map[string]struct{} {
+ return g.notarySetFunc(chainID, round)
}
-func (g *testGovernance) GetDKGSet(round uint64) map[string]struct{} {
- return g.getDKGSetFunc(round)
-}
-
-func (g *testGovernance) SubscribeNewCRSEvent(ch chan core.NewCRSEvent) event.Subscription {
- return nil
+func (g *testGovernance) DKGSet(round uint64) map[string]struct{} {
+ return g.dkgSetFunc(round)
}
// testPeer is a simulated peer to allow testing direct network calls.