aboutsummaryrefslogtreecommitdiffstats
path: root/core/test
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-10-02 15:45:29 +0800
committerGitHub <noreply@github.com>2018-10-02 15:45:29 +0800
commitfb27745f2ca4eaf66f53f48740cbd148ee15bbdf (patch)
tree1b706c5a93a4f09f27d2bc729cf55c5d4f0b5aaa /core/test
parentd7f6db871180b53548aed6a5450e1c5879c90b04 (diff)
downloaddexon-consensus-fb27745f2ca4eaf66f53f48740cbd148ee15bbdf.tar
dexon-consensus-fb27745f2ca4eaf66f53f48740cbd148ee15bbdf.tar.gz
dexon-consensus-fb27745f2ca4eaf66f53f48740cbd148ee15bbdf.tar.bz2
dexon-consensus-fb27745f2ca4eaf66f53f48740cbd148ee15bbdf.tar.lz
dexon-consensus-fb27745f2ca4eaf66f53f48740cbd148ee15bbdf.tar.xz
dexon-consensus-fb27745f2ca4eaf66f53f48740cbd148ee15bbdf.tar.zst
dexon-consensus-fb27745f2ca4eaf66f53f48740cbd148ee15bbdf.zip
core: replace reliable-broadcast with shard (#159)
Diffstat (limited to 'core/test')
-rw-r--r--core/test/governance.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/test/governance.go b/core/test/governance.go
index 6ae2462..ee4491f 100644
--- a/core/test/governance.go
+++ b/core/test/governance.go
@@ -62,7 +62,7 @@ func NewGovernance(nodeCount int, lambda time.Duration) (
DKGComplaint: make(map[uint64][]*types.DKGComplaint),
DKGMasterPublicKey: make(map[uint64][]*types.DKGMasterPublicKey),
RoundInterval: 365 * 86400 * time.Second,
- MinBlockInterval: lambda * 3,
+ MinBlockInterval: 1 * time.Millisecond,
MaxBlockInterval: lambda * 8,
}
for i := 0; i < nodeCount; i++ {
@@ -76,9 +76,9 @@ func NewGovernance(nodeCount int, lambda time.Duration) (
return
}
-// GetNodeSet implements Governance interface to return current
+// NodeSet implements Governance interface to return current
// notary set.
-func (g *Governance) GetNodeSet(_ uint64) (
+func (g *Governance) NodeSet(_ uint64) (
ret []crypto.PublicKey) {
for _, key := range g.privateKeys {
ret = append(ret, key.PublicKey())
@@ -86,8 +86,8 @@ func (g *Governance) GetNodeSet(_ uint64) (
return
}
-// GetConfiguration returns the configuration at a given block height.
-func (g *Governance) GetConfiguration(_ uint64) *types.Config {
+// Configuration returns the configuration at a given block height.
+func (g *Governance) Configuration(_ uint64) *types.Config {
return &types.Config{
NumShards: 1,
NumChains: uint32(len(g.privateKeys)),
@@ -104,8 +104,8 @@ func (g *Governance) GetConfiguration(_ uint64) *types.Config {
}
}
-// GetCRS returns the CRS for a given round.
-func (g *Governance) GetCRS(round uint64) common.Hash {
+// CRS returns the CRS for a given round.
+func (g *Governance) CRS(round uint64) common.Hash {
return g.crs[round]
}
@@ -114,9 +114,9 @@ func (g *Governance) ProposeCRS(round uint64, signedCRS []byte) {
g.crs[round] = crypto.Keccak256Hash(signedCRS)
}
-// GetPrivateKeys return the private key for that node, this function
+// PrivateKeys return the private key for that node, this function
// is a test utility and not a general Governance interface.
-func (g *Governance) GetPrivateKeys() (keys []crypto.PrivateKey) {
+func (g *Governance) PrivateKeys() (keys []crypto.PrivateKey) {
for _, k := range g.privateKeys {
keys = append(keys, k)
}