github.com/palisadeinc/bor@v0.0.0-20230615125219-ab7196213d15/consensus/bor/span.go (about)

     1  package bor
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/ethereum/go-ethereum/common"
     7  	"github.com/ethereum/go-ethereum/consensus/bor/heimdall/span"
     8  	"github.com/ethereum/go-ethereum/consensus/bor/valset"
     9  	"github.com/ethereum/go-ethereum/core"
    10  	"github.com/ethereum/go-ethereum/core/state"
    11  	"github.com/ethereum/go-ethereum/core/types"
    12  	"github.com/ethereum/go-ethereum/rpc"
    13  )
    14  
    15  //go:generate mockgen -destination=./span_mock.go -package=bor . Spanner
    16  type Spanner interface {
    17  	GetCurrentSpan(ctx context.Context, headerHash common.Hash) (*span.Span, error)
    18  	GetCurrentValidatorsByHash(ctx context.Context, headerHash common.Hash, blockNumber uint64) ([]*valset.Validator, error)
    19  	GetCurrentValidatorsByBlockNrOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash, blockNumber uint64) ([]*valset.Validator, error)
    20  	CommitSpan(ctx context.Context, heimdallSpan span.HeimdallSpan, state *state.StateDB, header *types.Header, chainContext core.ChainContext) error
    21  }