aboutsummaryrefslogtreecommitdiffstats
path: root/simulation/governance.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-09-27 14:27:18 +0800
committerGitHub <noreply@github.com>2018-09-27 14:27:18 +0800
commit506014f22faba150cd7197e7dd817e72a914dc84 (patch)
tree3f61287a4578c31c447cc8d9283fc3c728dd6cb7 /simulation/governance.go
parent9c2f700be09c27e8a8d12fc5bc0ccd017d408a32 (diff)
downloadtangerine-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar
tangerine-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.gz
tangerine-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.bz2
tangerine-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.lz
tangerine-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.xz
tangerine-consensus-506014f22faba150cd7197e7dd817e72a914dc84.tar.zst
tangerine-consensus-506014f22faba150cd7197e7dd817e72a914dc84.zip
core: update governance interface and config (#145)
1) Remove RoundHeight from config. 2) NotarySet is not from governance contract, we get Node set intead. Notary set is caculated from the NodeSet using CRS. 3) CRS is not in the governance interface.
Diffstat (limited to 'simulation/governance.go')
-rw-r--r--simulation/governance.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/simulation/governance.go b/simulation/governance.go
index a48e221..eb0f2a2 100644
--- a/simulation/governance.go
+++ b/simulation/governance.go
@@ -70,8 +70,8 @@ func (g *simGovernance) setNetwork(network *network) {
g.network = network
}
-// GetNotarySet returns the current notary set.
-func (g *simGovernance) GetNotarySet(
+// GetNodeSet returns the current notary set.
+func (g *simGovernance) GetNodeSet(
blockHeight uint64) map[types.NodeID]struct{} {
g.lock.RLock()
defer g.lock.RUnlock()
@@ -84,12 +84,11 @@ func (g *simGovernance) GetNotarySet(
return ret
}
-// GetConfiguration returns the configuration at a given block height.
-func (g *simGovernance) GetConfiguration(blockHeight uint64) *types.Config {
+// GetConfiguration returns the configuration at a given round.
+func (g *simGovernance) GetConfiguration(round uint64) *types.Config {
return &types.Config{
NumShards: 1,
NumChains: g.chainNum,
- CRS: g.crs,
LambdaBA: g.lambdaBA,
LambdaDKG: g.lambdaDKG,
K: g.k,
@@ -97,6 +96,11 @@ func (g *simGovernance) GetConfiguration(blockHeight uint64) *types.Config {
}
}
+// GetCRS returns the CRS for a given round.
+func (g *simGovernance) GetCRS(round uint64) []byte {
+ return g.crs
+}
+
// addNode add a new node into the simulated governance contract.
func (g *simGovernance) addNode(nID types.NodeID) {
g.lock.Lock()