diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-02-25 19:35:06 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:22 +0800 |
commit | bfac6dd5391b871d148713014f2694d31d9b6ea4 (patch) | |
tree | b80909c9f5ad6f6021b3ebacff51c73469401765 /consensus/dexcon/dexcon.go | |
parent | 2b2396b6bce0f21b515ac2d38556f6dca08b1770 (diff) | |
download | go-tangerine-bfac6dd5391b871d148713014f2694d31d9b6ea4.tar go-tangerine-bfac6dd5391b871d148713014f2694d31d9b6ea4.tar.gz go-tangerine-bfac6dd5391b871d148713014f2694d31d9b6ea4.tar.bz2 go-tangerine-bfac6dd5391b871d148713014f2694d31d9b6ea4.tar.lz go-tangerine-bfac6dd5391b871d148713014f2694d31d9b6ea4.tar.xz go-tangerine-bfac6dd5391b871d148713014f2694d31d9b6ea4.tar.zst go-tangerine-bfac6dd5391b871d148713014f2694d31d9b6ea4.zip |
core: vm: flatten governance
Diffstat (limited to 'consensus/dexcon/dexcon.go')
-rw-r--r-- | consensus/dexcon/dexcon.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/consensus/dexcon/dexcon.go b/consensus/dexcon/dexcon.go index aff5c9c45..c837e3a43 100644 --- a/consensus/dexcon/dexcon.go +++ b/consensus/dexcon/dexcon.go @@ -28,7 +28,7 @@ import ( ) type GovernanceStateFetcher interface { - GetGovStateHelperAtRound(round uint64) *vm.GovernanceStateHelper + GetStateForConfigAtRound(round uint64) *vm.GovernanceState } // Dexcon is a delegated proof-of-stake consensus engine. @@ -108,7 +108,7 @@ func (d *Dexcon) Prepare(chain consensus.ChainReader, header *types.Header) erro } func (d *Dexcon) calculateBlockReward(round int64, state *state.StateDB) *big.Int { - gs := d.govStateFetcer.GetGovStateHelperAtRound(uint64(round)) + gs := d.govStateFetcer.GetStateForConfigAtRound(uint64(round)) config := gs.Configuration() blocksPerRound := config.RoundLength @@ -134,7 +134,7 @@ func (d *Dexcon) calculateBlockReward(round int64, state *state.StateDB) *big.In // Finalize implements consensus.Engine, ensuring no uncles are set, nor block // rewards given, and returns the final block. func (d *Dexcon) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) { - gs := vm.GovernanceStateHelper{state} + gs := vm.GovernanceState{state} height := gs.RoundHeight(new(big.Int).SetUint64(header.Round)) if header.Round > 0 && height.Uint64() == 0 { |