Documentation ¶
Index ¶
Constants ¶
const ( // BlockStatusOnChain represents the identifier for an on-chain block BlockStatusOnChain = "on-chain" // BlockStatusReverted represent the identifier for a reverted block BlockStatusReverted = "reverted" )
Variables ¶
var ErrInvalidOutputFormat = errors.New("the output format type is invalid")
ErrInvalidOutputFormat signals that the output format type is not valid
var ErrMetachainOnlyEndpoint = errors.New("the endpoint is only available on metachain nodes")
ErrMetachainOnlyEndpoint signals that an endpoint was called, but it is only available for metachain nodes
var ErrShardOnlyEndpoint = errors.New("the endpoint is only available on shard nodes")
ErrShardOnlyEndpoint signals that an endpoint was called, but it is only available for shard nodes
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
ErrWrongTypeAssertion signals that an type assertion failed
Functions ¶
This section is empty.
Types ¶
type APIBlockHandler ¶
type APIBlockHandler interface { GetBlockByNonce(nonce uint64, withTxs bool) (*api.Block, error) GetBlockByHash(hash []byte, withTxs bool) (*api.Block, error) GetBlockByRound(round uint64, withTxs bool) (*api.Block, error) IsInterfaceNil() bool }
APIBlockHandler defines the behavior of a component able to return api blocks
func CreateAPIBlockProcessor ¶
func CreateAPIBlockProcessor(arg *ArgAPIBlockProcessor) (APIBlockHandler, error)
CreateAPIBlockProcessor will create a new instance of APIBlockHandler
type APIInternalBlockHandler ¶
type APIInternalBlockHandler interface { GetInternalShardBlockByNonce(format common.ApiOutputFormat, nonce uint64) (interface{}, error) GetInternalShardBlockByHash(format common.ApiOutputFormat, hash []byte) (interface{}, error) GetInternalShardBlockByRound(format common.ApiOutputFormat, round uint64) (interface{}, error) GetInternalMetaBlockByNonce(format common.ApiOutputFormat, nonce uint64) (interface{}, error) GetInternalMetaBlockByHash(format common.ApiOutputFormat, hash []byte) (interface{}, error) GetInternalMetaBlockByRound(format common.ApiOutputFormat, round uint64) (interface{}, error) GetInternalStartOfEpochMetaBlock(format common.ApiOutputFormat, epoch uint32) (interface{}, error) GetInternalMiniBlock(format common.ApiOutputFormat, hash []byte, epoch uint32) (interface{}, error) IsInterfaceNil() bool }
APIInternalBlockHandler defines the behaviour of a component able to return internal blocks
func CreateAPIInternalBlockProcessor ¶
func CreateAPIInternalBlockProcessor(arg *ArgAPIBlockProcessor) (APIInternalBlockHandler, error)
CreateAPIInternalBlockProcessor will create a new instance of APIInternalBlockHandler
type ArgAPIBlockProcessor ¶
type ArgAPIBlockProcessor struct { SelfShardID uint32 Store dataRetriever.StorageService Marshalizer marshal.Marshalizer Uint64ByteSliceConverter typeConverters.Uint64ByteSliceConverter HistoryRepo dblookupext.HistoryRepository TxUnmarshaller TransactionUnmarshaller StatusComputer transaction.StatusComputerHandler Hasher hashing.Hasher AddressPubkeyConverter core.PubkeyConverter }
ArgAPIBlockProcessor is structure that store components that are needed to create an api block processor
type TransactionUnmarshaller ¶
type TransactionUnmarshaller interface { UnmarshalTransaction(txBytes []byte, txType transaction.TxType) (*transaction.ApiTransactionResult, error) UnmarshalReceipt(receiptBytes []byte) (*transaction.ApiReceipt, error) IsInterfaceNil() bool }
TransactionUnmarshaller defines what a transaction unmarshaler should do