aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-17 00:33:28 +0800
committerGitHub <noreply@github.com>2019-03-17 00:33:28 +0800
commitb636901c60aa666c6c6b532d06e78b529537d315 (patch)
treeb08f213d2648a54f23bef0b8902678404adbacf2
parentc0e1c45539fe882c4cd096a41e36f764d5ad2092 (diff)
downloaddexon-consensus-b636901c60aa666c6c6b532d06e78b529537d315.tar
dexon-consensus-b636901c60aa666c6c6b532d06e78b529537d315.tar.gz
dexon-consensus-b636901c60aa666c6c6b532d06e78b529537d315.tar.bz2
dexon-consensus-b636901c60aa666c6c6b532d06e78b529537d315.tar.lz
dexon-consensus-b636901c60aa666c6c6b532d06e78b529537d315.tar.xz
dexon-consensus-b636901c60aa666c6c6b532d06e78b529537d315.tar.zst
dexon-consensus-b636901c60aa666c6c6b532d06e78b529537d315.zip
core: add GetRoundHeight interface (#493)
Add GetRoundHeight interface for core to query the being height of a round.
-rw-r--r--core/interfaces.go3
-rw-r--r--core/test/governance.go5
2 files changed, 8 insertions, 0 deletions
diff --git a/core/interfaces.go b/core/interfaces.go
index ddd6c3b..707563f 100644
--- a/core/interfaces.go
+++ b/core/interfaces.go
@@ -116,6 +116,9 @@ type Governance interface {
// Return the genesis node set if round == 0.
NodeSet(round uint64) []crypto.PublicKey
+ // Get the begin height of a round.
+ GetRoundHeight(round uint64) uint64
+
//// DKG-related methods.
// AddDKGComplaint adds a DKGComplaint.
diff --git a/core/test/governance.go b/core/test/governance.go
index 74eca85..42294fc 100644
--- a/core/test/governance.go
+++ b/core/test/governance.go
@@ -90,6 +90,11 @@ func (g *Governance) Configuration(round uint64) *types.Config {
return g.configs[round]
}
+// GetRoundHeight returns the begin height of a round.
+func (g *Governance) GetRoundHeight(round uint64) uint64 {
+ return 0
+}
+
// CRS returns the CRS for a given round.
func (g *Governance) CRS(round uint64) common.Hash {
return g.stateModule.CRS(round)