Documentation ¶
Index ¶
Constants ¶
const RetrialTimeoutMS = 50
Variables ¶
var ErrBlockBodyAssertion = errors.New("error asserting BodyHandler interface of type block body")
ErrBlockBodyAssertion signals that an error occurred when trying to assert BodyHandler interface of type block body
var ErrCannotCastAccountHandlerToUserAccount = errors.New("cannot cast AccountHandler to UserAccountHandler")
ErrCannotCastAccountHandlerToUserAccount signals an error when trying to cast from AccountHandler to UserAccountHandler
var ErrNilAccountsAdapter = errors.New("received nil input value: accounts adapter")
ErrNilAccountsAdapter signals that an accounts adapter input parameter is nil
var ErrNilDataHandler = errors.New("received nil input value: data handler")
ErrNilDataHandler signals that a nil data handler handler has been provided
var ErrNilHTTPServer = errors.New("received nil input value: http server")
ErrNilHTTPServer signals that a nil http server has been provided
var ErrNilHasher = errors.New("received nil input value: hasher")
ErrNilHasher signals that a nil hasher has been provided
var ErrNilMarshaller = errors.New("received nil input value: marshaller")
ErrNilMarshaller signals that a nil marshaller has been provided
var ErrNilMiniBlockHandler = errors.New("received nil input value: mini block handler")
ErrNilMiniBlockHandler signals that a nil mini block handler has been provided
var ErrNilPubKeyConverter = errors.New("received nil input value: pub key converter")
ErrNilPubKeyConverter signals that a pub key converter input parameter is nil
var ErrNilShardCoordinator = errors.New("received nil input value: shard coordinator")
ErrNilShardCoordinator signals that a shard coordinator input parameter is nil
Functions ¶
func NewCovalentDataIndexer ¶
func NewCovalentDataIndexer(processor DataHandler, server *http.Server) (*covalentIndexer, error)
NewCovalentDataIndexer creates a new instance of covalent data indexer, which implements Driver interface and converts protocol input data to covalent required data TODO should refactor as to avoid using *http.Server here. For testing purposes we should use httptest.Server Reason: all unit tests might fail, if for example, the machine that the tests run onto can not open the hardcoded port written in the tests (might have it already open by another process)
Types ¶
type AccountsAdapter ¶
type AccountsAdapter interface { LoadAccount(address []byte) (vmcommon.AccountHandler, error) IsInterfaceNil() bool }
type DataHandler ¶
type DataHandler interface {
ProcessData(args *indexer.ArgsSaveBlockData) (*schema.BlockResult, error)
}
type Driver ¶
type Driver interface { SaveBlock(args *indexer.ArgsSaveBlockData) error RevertIndexedBlock(header data.HeaderHandler, body data.BodyHandler) error SaveRoundsInfo(roundsInfos []*indexer.RoundInfo) error SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte, epoch uint32) error SaveValidatorsRating(indexID string, infoRating []*indexer.ValidatorRatingInfo) error SaveAccounts(blockTimestamp uint64, acc []data.UserAccountHandler) error FinalizedBlock(headerHash []byte) error Close() error IsInterfaceNil() bool }