github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/evm/types/interface.go (about)

     1  package types
     2  
     3  import (
     4  	"github.com/ethereum/go-ethereum/common"
     5  	ethtypes "github.com/ethereum/go-ethereum/core/types"
     6  	sdk "github.com/fibonacci-chain/fbc/libs/cosmos-sdk/types"
     7  )
     8  
     9  // Event Hooks
    10  // These can be utilized to customize evm transaction processing.
    11  
    12  // EvmHooks event hooks for evm tx processing
    13  type EvmHooks interface {
    14  	// PostTxProcessing Must be called after tx is processed successfully, if return an error, the whole transaction is reverted.
    15  	PostTxProcessing(ctx sdk.Context, st *StateTransition, receipt *ethtypes.Receipt) error
    16  }
    17  
    18  // EvmLogHandler defines the interface for evm log handler
    19  type EvmLogHandler interface {
    20  	// EventID Return the id of the log signature it handles
    21  	EventID() common.Hash
    22  	// Handle Process the log
    23  	Handle(ctx sdk.Context, contract common.Address, data []byte) error
    24  }