aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/governance.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-06 14:30:05 +0800
committerGitHub <noreply@github.com>2018-12-06 14:30:05 +0800
commit41753e517c68575589c485b3f9570db94e59bcd0 (patch)
tree88ca8e57415164bce765658f3f55d51e85646eb3 /core/test/governance.go
parent4eb02f1dd96e136b0f7cf7eff792da1e44176713 (diff)
downloaddexon-consensus-41753e517c68575589c485b3f9570db94e59bcd0.tar
dexon-consensus-41753e517c68575589c485b3f9570db94e59bcd0.tar.gz
dexon-consensus-41753e517c68575589c485b3f9570db94e59bcd0.tar.bz2
dexon-consensus-41753e517c68575589c485b3f9570db94e59bcd0.tar.lz
dexon-consensus-41753e517c68575589c485b3f9570db94e59bcd0.tar.xz
dexon-consensus-41753e517c68575589c485b3f9570db94e59bcd0.tar.zst
dexon-consensus-41753e517c68575589c485b3f9570db94e59bcd0.zip
test: allow to log in test.State (#359)
Diffstat (limited to 'core/test/governance.go')
-rw-r--r--core/test/governance.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/core/test/governance.go b/core/test/governance.go
index 14c8177..9bb042e 100644
--- a/core/test/governance.go
+++ b/core/test/governance.go
@@ -24,7 +24,6 @@ import (
"reflect"
"sort"
"sync"
- "time"
"github.com/dexon-foundation/dexon-consensus/common"
"github.com/dexon-foundation/dexon-consensus/core/crypto"
@@ -48,16 +47,12 @@ type Governance struct {
}
// NewGovernance constructs a Governance instance.
-func NewGovernance(genesisNodes []crypto.PublicKey, lambda time.Duration,
- roundShift uint64) (g *Governance, err error) {
+func NewGovernance(state *State, roundShift uint64) (g *Governance, err error) {
// Setup a State instance.
- // TODO(mission): it's not a good idea to embed initialization of one
- // public class in another, I did this to make the range of
- // modification smaller.
g = &Governance{
roundShift: roundShift,
pendingConfigChanges: make(map[uint64]map[StateChangeType]interface{}),
- stateModule: NewState(genesisNodes, lambda, true),
+ stateModule: state,
}
return
}