github.com/amazechain/amc@v0.1.3/internal/types.go (about)

     1  // Copyright 2023 The AmazeChain Authors
     2  // This file is part of the AmazeChain library.
     3  //
     4  // The AmazeChain library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The AmazeChain library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the AmazeChain library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package internal
    18  
    19  import (
    20  	"github.com/amazechain/amc/common/block"
    21  	"github.com/amazechain/amc/common/types"
    22  	"github.com/amazechain/amc/modules/state"
    23  	"github.com/holiman/uint256"
    24  )
    25  
    26  // Validator is an interface which defines the standard for block validation. It
    27  // is only responsible for validating block contents, as the header validation is
    28  // done by the specific consensus engines.
    29  //type Validator interface {
    30  //	// ValidateBody validates the given block's content.
    31  //	ValidateBody(block *block.Block) error
    32  //
    33  //	// ValidateState validates the given statedb and optionally the receipts and
    34  //	// gas used.
    35  //	ValidateState(block *block.Block, state *state.StateDB, receipts block.Receipts, usedGas uint64) error
    36  //}
    37  //
    38  //// Prefetcher is an interface for pre-caching transaction signatures and state.
    39  //type Prefetcher interface {
    40  //	// Prefetch processes the state changes according to the Ethereum rules by running
    41  //	// the transaction messages using the statedb, but any changes are discarded. The
    42  //	// only goal is to pre-cache transaction signatures and state trie nodes.
    43  //	Prefetch(block *block.Block, statedb *state.StateDB, cfg vm.Config, interrupt *uint32)
    44  //}
    45  
    46  // Processor is an interface for processing blocks using a given initial state.
    47  type Processor interface {
    48  	// Process processes the state changes according to the Ethereum rules by running
    49  	// the transaction messages using the statedb and applying any rewards to both
    50  	// the processor (coinbase) and any included uncles.
    51  	Process(b *block.Block, ibs *state.IntraBlockState, stateReader state.StateReader, stateWriter state.WriterWithChangeSets, blockHashFunc func(n uint64) types.Hash) (block.Receipts, map[types.Address]*uint256.Int, []*block.Log, uint64, error)
    52  }