github.com/arieschain/arieschain@v0.0.0-20191023063405-37c074544356/core/types.go (about)

     1  package core
     2  
     3  import (
     4  	"github.com/quickchainproject/quickchain/core/state"
     5  	"github.com/quickchainproject/quickchain/core/types"
     6  	"github.com/quickchainproject/quickchain/core/vm"
     7  )
     8  
     9  // Validator is an interface which defines the standard for block validation. It
    10  // is only responsible for validating block contents, as the header validation is
    11  // done by the specific consensus engines.
    12  //
    13  type Validator interface {
    14  	// ValidateBody validates the given block's content.
    15  	ValidateBody(block *types.Block) error
    16  
    17  	// ValidateState validates the given statedb and optionally the receipts and
    18  	// gas used.
    19  	ValidateState(block, parent *types.Block, state *state.StateDB, receipts types.Receipts, usedGas uint64) error
    20  
    21  	// ValidateDposState validates the given dpos state
    22  	ValidateDposState(block *types.Block) error
    23  }
    24  
    25  // Processor is an interface for processing blocks using a given initial state.
    26  //
    27  // Process takes the block to be processed and the statedb upon which the
    28  // initial state is based. It should return the receipts generated, amount
    29  // of gas used in the process and return an error if any of the internal rules
    30  // failed.
    31  type Processor interface {
    32  	Process(block *types.Block, statedb *state.StateDB, cfg vm.Config) (types.Receipts, []*types.Log, uint64, error)
    33  }