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@byzantine-lab.io>2019-06-12 17:23:39 +0800
commitf4d15de52885a472ffb4ae5982662ec3f41ebebc (patch)
tree7ac7bdb3724e63a55930382edfb30d2283ce028b /dex/helper_test.go
parent2e1556d551420e5f52d6e4e157b46963277eaccd (diff)
downloadgo-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.gz
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.bz2
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.lz
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.xz
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.tar.zst
go-tangerine-f4d15de52885a472ffb4ae5982662ec3f41ebebc.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.