diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-09-18 17:57:36 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-18 17:57:36 +0800 |
commit | 8c33027b943e08de21b7bddb82fecc2b2a5664a2 (patch) | |
tree | eaa282b1238eb609d710e9c45bb0689e7a399039 /core/consensus_test.go | |
parent | 476c759f5e2ea3949cf3aaf4e60ccc7e0439ee73 (diff) | |
download | dexon-consensus-8c33027b943e08de21b7bddb82fecc2b2a5664a2.tar.gz dexon-consensus-8c33027b943e08de21b7bddb82fecc2b2a5664a2.tar.zst dexon-consensus-8c33027b943e08de21b7bddb82fecc2b2a5664a2.zip |
core: refine governance interface to reduce Get* methods (#114)
Since we have a bunch of static configurations in the governance
contract, instead of using a Get* method for each of them, we instead
implement a GetConfiguration() method to return a structure of the configurations.
Diffstat (limited to 'core/consensus_test.go')
-rw-r--r-- | core/consensus_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/consensus_test.go b/core/consensus_test.go index e799675..dd64cc2 100644 --- a/core/consensus_test.go +++ b/core/consensus_test.go @@ -81,8 +81,8 @@ func (s *ConsensusTestSuite) prepareConsensus( app := test.NewApp() db, err := blockdb.NewMemBackedBlockDB() s.Require().Nil(err) - prv, exist := gov.PrivateKeys[vID] - s.Require().True(exist) + prv, exist := gov.GetPrivateKey(vID) + s.Require().Nil(exist) con := NewConsensus(app, gov, db, &network{}, prv, eth.SigToPub) return &con.app, con } @@ -107,7 +107,7 @@ func (s *ConsensusTestSuite) TestSimpleDeliverBlock() { ) s.Require().Nil(err) - for vID := range gov.GetValidatorSet() { + for vID := range gov.GetNotarySet() { validators = append(validators, vID) } @@ -329,7 +329,7 @@ func (s *ConsensusTestSuite) TestPrepareBlock() { validators []types.ValidatorID ) s.Require().Nil(err) - for vID := range gov.GetValidatorSet() { + for vID := range gov.GetNotarySet() { validators = append(validators, vID) } // Setup core.Consensus and test.App. @@ -384,7 +384,7 @@ func (s *ConsensusTestSuite) TestPrepareGenesisBlock() { validators []types.ValidatorID ) s.Require().Nil(err) - for vID := range gov.GetValidatorSet() { + for vID := range gov.GetNotarySet() { validators = append(validators, vID) } _, con := s.prepareConsensus(gov, validators[0]) |