mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
9b63764b16
Now all protocol-stipulated changes at the beginning of the block (AuRa stuff, [DAO](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/dao-fork.md) irregular state change, Calcutta system contract upgrade, [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788) beacon root) are handled by consensus engine `Initialize()`.
29 lines
908 B
Go
29 lines
908 B
Go
package bor
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon-lib/chain"
|
|
"github.com/ledgerwatch/erigon/consensus"
|
|
"github.com/ledgerwatch/erigon/consensus/ethash"
|
|
"github.com/ledgerwatch/erigon/core/state"
|
|
"github.com/ledgerwatch/erigon/core/types"
|
|
"github.com/ledgerwatch/log/v3"
|
|
)
|
|
|
|
type FakeBor struct {
|
|
*ethash.FakeEthash
|
|
}
|
|
|
|
// NewFaker creates a bor consensus engine with a FakeEthash
|
|
func NewFaker() *FakeBor {
|
|
return &FakeBor{
|
|
FakeEthash: ethash.NewFaker(),
|
|
}
|
|
}
|
|
|
|
func (f *FakeBor) Finalize(config *chain.Config, header *types.Header, state *state.IntraBlockState,
|
|
txs types.Transactions, uncles []*types.Header, r types.Receipts, withdrawals []*types.Withdrawal,
|
|
chain consensus.ChainReader, syscall consensus.SystemCall, logger log.Logger,
|
|
) (types.Transactions, types.Receipts, error) {
|
|
return f.FakeEthash.Finalize(config, header, state, txs, uncles, r, withdrawals, chain, syscall, logger)
|
|
}
|