dblookupext

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthEpochByHash        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEpochByHash          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEpochByHash = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMiniblockMetadata        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMiniblockMetadata          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMiniblockMetadata = fmt.Errorf("proto: unexpected end of group")
)

Functions

func NewHistoryRepository

func NewHistoryRepository(arguments HistoryRepositoryArguments) (*historyRepository, error)

NewHistoryRepository will create a new instance of HistoryRepository

func NewNilHistoryRepository

func NewNilHistoryRepository() (*nilHistoryRepository, error)

NewNilHistoryRepository returns a not implemented history repository

Types

type BlockTracker

type BlockTracker interface {
	RegisterCrossNotarizedHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterSelfNotarizedFromCrossHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterSelfNotarizedHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterFinalMetachainHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	IsInterfaceNil() bool
}

BlockTracker defines the interface of the block tracker

type EpochByHash

type EpochByHash struct {
	Epoch uint32 `protobuf:"varint,1,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
}

EpochByHash is used to store information about a hash to know which epoch it belongs to

func (*EpochByHash) Descriptor

func (*EpochByHash) Descriptor() ([]byte, []int)

func (*EpochByHash) Equal

func (this *EpochByHash) Equal(that interface{}) bool

func (*EpochByHash) GetEpoch

func (m *EpochByHash) GetEpoch() uint32

func (*EpochByHash) GoString

func (this *EpochByHash) GoString() string

func (*EpochByHash) Marshal

func (m *EpochByHash) Marshal() (dAtA []byte, err error)

func (*EpochByHash) MarshalTo

func (m *EpochByHash) MarshalTo(dAtA []byte) (int, error)

func (*EpochByHash) MarshalToSizedBuffer

func (m *EpochByHash) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EpochByHash) ProtoMessage

func (*EpochByHash) ProtoMessage()

func (*EpochByHash) Reset

func (m *EpochByHash) Reset()

func (*EpochByHash) Size

func (m *EpochByHash) Size() (n int)

func (*EpochByHash) String

func (this *EpochByHash) String() string

func (*EpochByHash) Unmarshal

func (m *EpochByHash) Unmarshal(dAtA []byte) error

func (*EpochByHash) XXX_DiscardUnknown

func (m *EpochByHash) XXX_DiscardUnknown()

func (*EpochByHash) XXX_Marshal

func (m *EpochByHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EpochByHash) XXX_Merge

func (m *EpochByHash) XXX_Merge(src proto.Message)

func (*EpochByHash) XXX_Size

func (m *EpochByHash) XXX_Size() int

func (*EpochByHash) XXX_Unmarshal

func (m *EpochByHash) XXX_Unmarshal(b []byte) error

type HistoryRepository

type HistoryRepository interface {
	RecordBlock(blockHeaderHash []byte, blockHeader data.HeaderHandler, blockBody data.BodyHandler) error
	OnNotarizedBlocks(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)
	GetMiniblockMetadataByTxHash(hash []byte) (*MiniblockMetadata, error)
	GetEpochByHash(hash []byte) (uint32, error)
	IsEnabled() bool
	IsInterfaceNil() bool
}

HistoryRepository provides methods needed for the history data processing

type HistoryRepositoryArguments

type HistoryRepositoryArguments struct {
	SelfShardID                 uint32
	MiniblocksMetadataStorer    storage.Storer
	MiniblockHashByTxHashStorer storage.Storer
	EpochByHashStorer           storage.Storer
	Marshalizer                 marshal.Marshalizer
	Hasher                      hashing.Hasher
}

HistoryRepositoryArguments is a structure that stores all components that are needed to a history processor

type HistoryRepositoryFactory

type HistoryRepositoryFactory interface {
	Create() (HistoryRepository, error)
	IsInterfaceNil() bool
}

HistoryRepositoryFactory can create new instances of HistoryRepository

type MiniblockMetadata

type MiniblockMetadata struct {
	SourceShardID                     uint32 `protobuf:"varint,1,opt,name=SourceShardID,proto3" json:"SourceShardID,omitempty"`
	DestinationShardID                uint32 `protobuf:"varint,2,opt,name=DestinationShardID,proto3" json:"DestinationShardID,omitempty"`
	Round                             uint64 `protobuf:"varint,3,opt,name=Round,proto3" json:"Round,omitempty"`
	HeaderNonce                       uint64 `protobuf:"varint,4,opt,name=HeaderNonce,proto3" json:"HeaderNonce,omitempty"`
	HeaderHash                        []byte `protobuf:"bytes,5,opt,name=HeaderHash,proto3" json:"HeaderHash,omitempty"`
	MiniblockHash                     []byte `protobuf:"bytes,6,opt,name=MiniblockHash,proto3" json:"MiniblockHash,omitempty"`
	DeprecatedStatus                  []byte `protobuf:"bytes,7,opt,name=DeprecatedStatus,proto3" json:"DeprecatedStatus,omitempty"` // Deprecated: Do not use.
	Epoch                             uint32 `protobuf:"varint,8,opt,name=Epoch,proto3" json:"Epoch,omitempty"`
	NotarizedAtSourceInMetaNonce      uint64 `protobuf:"varint,9,opt,name=NotarizedAtSourceInMetaNonce,proto3" json:"NotarizedAtSourceInMetaNonce,omitempty"`
	NotarizedAtDestinationInMetaNonce uint64 `protobuf:"varint,10,opt,name=NotarizedAtDestinationInMetaNonce,proto3" json:"NotarizedAtDestinationInMetaNonce,omitempty"`
	NotarizedAtSourceInMetaHash       []byte `protobuf:"bytes,11,opt,name=NotarizedAtSourceInMetaHash,proto3" json:"NotarizedAtSourceInMetaHash,omitempty"`
	NotarizedAtDestinationInMetaHash  []byte `protobuf:"bytes,12,opt,name=NotarizedAtDestinationInMetaHash,proto3" json:"NotarizedAtDestinationInMetaHash,omitempty"`
	Type                              int32  `protobuf:"varint,13,opt,name=Type,proto3" json:"Type,omitempty"`
}

MiniblockMetadata is used to store information about a history transaction

func (*MiniblockMetadata) Descriptor

func (*MiniblockMetadata) Descriptor() ([]byte, []int)

func (*MiniblockMetadata) Equal

func (this *MiniblockMetadata) Equal(that interface{}) bool

func (*MiniblockMetadata) GetDeprecatedStatus deprecated

func (m *MiniblockMetadata) GetDeprecatedStatus() []byte

Deprecated: Do not use.

func (*MiniblockMetadata) GetDestinationShardID

func (m *MiniblockMetadata) GetDestinationShardID() uint32

func (*MiniblockMetadata) GetEpoch

func (m *MiniblockMetadata) GetEpoch() uint32

func (*MiniblockMetadata) GetHeaderHash

func (m *MiniblockMetadata) GetHeaderHash() []byte

func (*MiniblockMetadata) GetHeaderNonce

func (m *MiniblockMetadata) GetHeaderNonce() uint64

func (*MiniblockMetadata) GetMiniblockHash

func (m *MiniblockMetadata) GetMiniblockHash() []byte

func (*MiniblockMetadata) GetNotarizedAtDestinationInMetaHash

func (m *MiniblockMetadata) GetNotarizedAtDestinationInMetaHash() []byte

func (*MiniblockMetadata) GetNotarizedAtDestinationInMetaNonce

func (m *MiniblockMetadata) GetNotarizedAtDestinationInMetaNonce() uint64

func (*MiniblockMetadata) GetNotarizedAtSourceInMetaHash

func (m *MiniblockMetadata) GetNotarizedAtSourceInMetaHash() []byte

func (*MiniblockMetadata) GetNotarizedAtSourceInMetaNonce

func (m *MiniblockMetadata) GetNotarizedAtSourceInMetaNonce() uint64

func (*MiniblockMetadata) GetRound

func (m *MiniblockMetadata) GetRound() uint64

func (*MiniblockMetadata) GetSourceShardID

func (m *MiniblockMetadata) GetSourceShardID() uint32

func (*MiniblockMetadata) GetType

func (m *MiniblockMetadata) GetType() int32

func (*MiniblockMetadata) GoString

func (this *MiniblockMetadata) GoString() string

func (*MiniblockMetadata) Marshal

func (m *MiniblockMetadata) Marshal() (dAtA []byte, err error)

func (*MiniblockMetadata) MarshalTo

func (m *MiniblockMetadata) MarshalTo(dAtA []byte) (int, error)

func (*MiniblockMetadata) MarshalToSizedBuffer

func (m *MiniblockMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MiniblockMetadata) ProtoMessage

func (*MiniblockMetadata) ProtoMessage()

func (*MiniblockMetadata) Reset

func (m *MiniblockMetadata) Reset()

func (*MiniblockMetadata) Size

func (m *MiniblockMetadata) Size() (n int)

func (*MiniblockMetadata) String

func (this *MiniblockMetadata) String() string

func (*MiniblockMetadata) Unmarshal

func (m *MiniblockMetadata) Unmarshal(dAtA []byte) error

func (*MiniblockMetadata) XXX_DiscardUnknown

func (m *MiniblockMetadata) XXX_DiscardUnknown()

func (*MiniblockMetadata) XXX_Marshal

func (m *MiniblockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MiniblockMetadata) XXX_Merge

func (m *MiniblockMetadata) XXX_Merge(src proto.Message)

func (*MiniblockMetadata) XXX_Size

func (m *MiniblockMetadata) XXX_Size() int

func (*MiniblockMetadata) XXX_Unmarshal

func (m *MiniblockMetadata) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL