diff options
author | Sonic <sonic@cobinhood.com> | 2018-10-14 22:39:11 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 13:49:53 +0800 |
commit | 2e6d95317f24212550352f9726cc18dbb390fb63 (patch) | |
tree | 917e7457681a696ef328acff247aaffe0d557a86 /dex/helper_test.go | |
parent | cada6546668db5b0f02d55bfb4a9d232b8185cf5 (diff) | |
download | dexon-2e6d95317f24212550352f9726cc18dbb390fb63.tar dexon-2e6d95317f24212550352f9726cc18dbb390fb63.tar.gz dexon-2e6d95317f24212550352f9726cc18dbb390fb63.tar.bz2 dexon-2e6d95317f24212550352f9726cc18dbb390fb63.tar.lz dexon-2e6d95317f24212550352f9726cc18dbb390fb63.tar.xz dexon-2e6d95317f24212550352f9726cc18dbb390fb63.tar.zst dexon-2e6d95317f24212550352f9726cc18dbb390fb63.zip |
dex: add method to get NumChains, NotarySet, DKGSet easily
Diffstat (limited to 'dex/helper_test.go')
-rw-r--r-- | dex/helper_test.go | 22 |
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. |