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>2018-12-19 20:54:27 +0800
commitbc4075d5c095ea29f576f546fdeb245a0e00d4ea (patch)
tree4b36b7433d9730638e5ebf2acf22f48650de11e0 /dex/helper_test.go
parent95379029f2e3eb0ffd2c1a6c151100062cb5d5cc (diff)
downloaddexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.gz
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.bz2
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.lz
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.xz
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.tar.zst
dexon-bc4075d5c095ea29f576f546fdeb245a0e00d4ea.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.