Skip to content

Commit

Permalink
adapt interface
Browse files Browse the repository at this point in the history
  • Loading branch information
somewheel committed Aug 27, 2021
1 parent 7fa0159 commit 4a0ef99
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 69 deletions.
24 changes: 17 additions & 7 deletions common/big.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
package common

import (
"math/big"

"github.com/holiman/uint256"
)

var (
Big0 = uint256.NewInt(0)
Big1 = uint256.NewInt(1)
Big2 = uint256.NewInt(2)
Big3 = uint256.NewInt(3)
Big32 = uint256.NewInt(32)
Big256 = uint256.NewInt(256)
Big257 = uint256.NewInt(257)
Big0 = big.NewInt(0)
Big1 = big.NewInt(1)
Big2 = big.NewInt(2)
Big3 = big.NewInt(3)
Big32 = big.NewInt(32)
Big256 = big.NewInt(256)
Big257 = big.NewInt(257)

UBig0 = uint256.NewInt(0)
UBig1 = uint256.NewInt(1)
UBig2 = uint256.NewInt(2)
UBig3 = uint256.NewInt(3)
UBig32 = uint256.NewInt(32)
UBig256 = uint256.NewInt(256)
UBig257 = uint256.NewInt(257)
)
4 changes: 2 additions & 2 deletions consensus/aura/aura.go
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ func (c *AuRa) Initialize(config *params.ChainConfig, chain consensus.ChainHeade
}

//word `signal epoch` == word `pending epoch`
func (c *AuRa) Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall) error {
func (c *AuRa) Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, systemTxs []types.Transaction, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall) error {
// accumulateRewards retrieves rewards for a block and applies them to the coinbase accounts for miner and uncle miners
beneficiaries, _, rewards, err := AccumulateRewards(config, c, header, uncles, syscall)
if err != nil {
Expand Down Expand Up @@ -977,7 +977,7 @@ func allHeadersUntil(chain consensus.ChainHeaderReader, from *types.Header, to c
// FinalizeAndAssemble implements consensus.Engine
func (c *AuRa) FinalizeAndAssemble(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts,
e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall, call consensus.Call) (*types.Block, error) {
c.Finalize(chainConfig, header, state, txs, uncles, r, e, chain, syscall)
c.Finalize(chainConfig, header, state, nil, txs, uncles, r, e, chain, syscall)

// Assemble and return the final block for sealing
return types.NewBlock(header, txs, uncles, r), nil
Expand Down
2 changes: 1 addition & 1 deletion consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func (c *Clique) Initialize(config *params.ChainConfig, chain consensus.ChainHea

// Finalize implements consensus.Engine, ensuring no uncles are set, nor block
// rewards given.
func (c *Clique) Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall) error {
func (c *Clique) Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, systemTxs []types.Transaction, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall) error {
// No block rewards in PoA, so the state remains as is and uncles are dropped
header.UncleHash = types.CalcUncleHash(nil)
return nil
Expand Down
Loading

0 comments on commit 4a0ef99

Please sign in to comment.