store

package
v0.0.0-...-9dda5dc Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlockHeaderKeyPrefix         = []byte{0x01}
	TxMessageKeyPrefix           = []byte{0x02}
	ScannedHeightKeyPrefix       = []byte{0x03}
	NewFinalityProviderKeyPrefix = []byte{0x04}
	CreateBTCDelegationKeyPrefix = []byte{0x05}
	CommitPubRandListKeyPrefix   = []byte{0x06}
	SignatureKeyPrefix           = []byte{0x07}
)

Functions

This section is empty.

Types

type BlockHeader

type BlockHeader struct {
	Hash       []byte `json:"hash"`
	ParentHash []byte `json:"parent_hash"`
	Number     int64  `json:"number"`
	Timestamp  int64  `json:"timestamp"`
}

type CommitPubRandList

type CommitPubRandList struct {
	CPR    types.MsgCommitPubRandList
	TxHash []byte `json:"tx_hash"`
}

type CreateBTCDelegation

type CreateBTCDelegation struct {
	CBD    types.MsgCreateBTCDelegation
	TxHash []byte `json:"tx_hash"`
}

type CreateFinalityProvider

type CreateFinalityProvider struct {
	FP     types.MsgCreateFinalityProvider
	TxHash []byte `json:"tx_hash"`
}

type Signature

type Signature struct {
	BlockNumber     int64  `json:"block_number"`
	TransactionHash []byte `json:"transaction_hash"`
	Data            []byte `json:"data"`
	Timestamp       int64  `json:"timestamp"`
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(levelDbFolder string) (*Storage, error)

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) GetBlockHeader

func (s *Storage) GetBlockHeader(number int64) (bool, BlockHeader)

func (*Storage) GetCommitPubRandListMsg

func (s *Storage) GetCommitPubRandListMsg(txHash []byte) (bool, CommitPubRandList)

func (*Storage) GetCreateBTCDelegationrMsg

func (s *Storage) GetCreateBTCDelegationrMsg(txHash []byte) (bool, CreateBTCDelegation)

func (*Storage) GetCreateFinalityProviderMsg

func (s *Storage) GetCreateFinalityProviderMsg(txHash []byte) (bool, CreateFinalityProvider)

func (*Storage) GetScannedHeight

func (s *Storage) GetScannedHeight() (uint64, error)

func (*Storage) GetSignature

func (s *Storage) GetSignature(BlockNumber int64) (Signature, error)

func (*Storage) GetTxMessage

func (s *Storage) GetTxMessage(txHash []byte) (bool, TxMessage)

func (*Storage) ResetScanHeight

func (s *Storage) ResetScanHeight(height uint64) error

func (*Storage) SetBlockHeader

func (s *Storage) SetBlockHeader(header BlockHeader) error

func (*Storage) SetBlockHeaders

func (s *Storage) SetBlockHeaders(headers []BlockHeader) error

func (*Storage) SetCommitPubRandListMsg

func (s *Storage) SetCommitPubRandListMsg(event CommitPubRandList) error

func (*Storage) SetCreateBTCDelegationMsg

func (s *Storage) SetCreateBTCDelegationMsg(msg CreateBTCDelegation) error

func (*Storage) SetCreateFinalityProviderMsg

func (s *Storage) SetCreateFinalityProviderMsg(msg CreateFinalityProvider) error

func (*Storage) SetSignature

func (s *Storage) SetSignature(sign Signature) error

func (*Storage) SetTxMessage

func (s *Storage) SetTxMessage(msg TxMessage) error

func (*Storage) SetTxMessages

func (s *Storage) SetTxMessages(msgs []TxMessage) error

func (*Storage) UpdateHeight

func (s *Storage) UpdateHeight(height uint64) error

type TxMessage

type TxMessage struct {
	BlockHeight     uint64 `json:"block_height"`
	TransactionHash []byte `json:"transaction_hash"`
	Type            string `json:"type"`
	Data            []byte `json:"data"`
	Timestamp       int64  `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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