store

package
v0.0.0-...-8b4944a Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BabylonBlockHeaderKeyPrefix        = []byte{0x01}
	EthBlockHeaderKeyPrefix            = []byte{0x02}
	TxMessageKeyPrefix                 = []byte{0x03}
	EthScannedHeightKeyPrefix          = []byte{0x04}
	BabylonScannedHeightKeyPrefix      = []byte{0x05}
	NewFinalityProviderKeyPrefix       = []byte{0x06}
	CreateBTCDelegationKeyPrefix       = []byte{0x07}
	CommitPubRandListKeyPrefix         = []byte{0x08}
	SignatureKeyPrefix                 = []byte{0x09}
	ContractEventKeyPrefix             = []byte{0x10}
	ActiveMemberKeyPrefix              = []byte{0x11}
	BtcUndelegateKeyPrefix             = []byte{0x12}
	BTCDelegateAmountKeyPrefix         = []byte{0x13}
	SelectiveSlashingEvidenceKeyPrefix = []byte{0x14}
	BabylonDelegationKeyPrefix         = []byte{0x15}
)

Functions

This section is empty.

Types

type BabylonBlockHeader

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

type BtcUndelegate

type BtcUndelegate struct {
	BU     types.MsgBTCUndelegate
	TxHash []byte `json:"tx_hash"`
}

type CommitPubRandList

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

type ContractEvent

type ContractEvent struct {
	BlockHeight     uint64         `json:"block_height"`
	ContractAddress common.Address `json:"contract_address"`
	TransactionHash common.Hash    `json:"transaction_hash"`
	LogIndex        uint64         `json:"log_index"`
	EventSignature  common.Hash    `json:"event_signature"`
	RLPLog          *types.Log     `json:"rlp_log"`
	Timestamp       uint64         `json:"timestamp"`
}

func ContractEventFromLog

func ContractEventFromLog(log *types.Log, timestamp uint64) ContractEvent

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 EthBlockHeader

type EthBlockHeader struct {
	Hash       common.Hash `json:"hash"`
	ParentHash common.Hash `json:"parent_hash"`
	Number     int64       `json:"number"`
	Timestamp  int64       `json:"timestamp"`
}

type NodeMembers

type NodeMembers struct {
	Members []string `json:"members"`
}

type OperatorRegistered

type OperatorRegistered struct {
	BlockNumber int64          `json:"block_number"`
	TxHash      common.Hash    `json:"tx_hash"`
	Operator    common.Address `json:"operator"`
	NodeUrl     string         `json:"node_url"`
	Timestamp   uint64         `json:"timestamp"`
}

type SelectiveSlashingEvidence

type SelectiveSlashingEvidence struct {
	SSE    types.MsgSelectiveSlashingEvidence
	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) GetActiveMember

func (s *Storage) GetActiveMember() (NodeMembers, error)

func (*Storage) GetBTCDelegateAmount

func (s *Storage) GetBTCDelegateAmount(address []byte) (uint64, error)

func (*Storage) GetBabylonBlockHeader

func (s *Storage) GetBabylonBlockHeader(number int64) (bool, BabylonBlockHeader)

func (*Storage) GetBabylonDelegationKey

func (s *Storage) GetBabylonDelegationKey(btcTx []byte) ([]byte, error)

func (*Storage) GetBabylonScannedHeight

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

func (*Storage) GetBtcUndelegateMsg

func (s *Storage) GetBtcUndelegateMsg(txHash []byte) (bool, BtcUndelegate)

func (*Storage) GetCommitPubRandListMsg

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

func (*Storage) GetContractEvent

func (s *Storage) GetContractEvent(txHash []byte) (bool, ContractEvent)

func (*Storage) GetCreateBTCDelegationMsg

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

func (*Storage) GetCreateFinalityProviderMsg

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

func (*Storage) GetEthBlockHeader

func (s *Storage) GetEthBlockHeader(number int64) (EthBlockHeader, error)

func (*Storage) GetEthScannedHeight

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

func (*Storage) GetSelectiveSlashingEvidenceMsg

func (s *Storage) GetSelectiveSlashingEvidenceMsg(txHash []byte) (bool, SelectiveSlashingEvidence)

func (*Storage) GetSignature

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

func (*Storage) GetTxMessage

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

func (*Storage) ResetBabylonScanHeight

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

func (*Storage) ResetEthScanHeight

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

func (*Storage) SetBabylonBlockHeader

func (s *Storage) SetBabylonBlockHeader(header BabylonBlockHeader) error

func (*Storage) SetBabylonBlockHeaders

func (s *Storage) SetBabylonBlockHeaders(headers []BabylonBlockHeader) error

func (*Storage) SetBabylonDelegationKey

func (s *Storage) SetBabylonDelegationKey(babylonTx []byte, btcTx []byte) error

func (*Storage) SetBtcUndelegateMsg

func (s *Storage) SetBtcUndelegateMsg(msg BtcUndelegate) error

func (*Storage) SetCommitPubRandListMsg

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

func (*Storage) SetContractEvent

func (s *Storage) SetContractEvent(event ContractEvent) error

func (*Storage) SetContractEvents

func (s *Storage) SetContractEvents(events []ContractEvent) error

func (*Storage) SetCreateBTCDelegationMsg

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

func (*Storage) SetCreateFinalityProviderMsg

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

func (*Storage) SetEthBlockHeader

func (s *Storage) SetEthBlockHeader(header EthBlockHeader) error

func (*Storage) SetEthBlockHeaders

func (s *Storage) SetEthBlockHeaders(headers []EthBlockHeader) error

func (*Storage) SetOperatorRegisteredEvent

func (s *Storage) SetOperatorRegisteredEvent(event OperatorRegistered) error

func (*Storage) SetSelectiveSlashingEvidenceMsg

func (s *Storage) SetSelectiveSlashingEvidenceMsg(msg SelectiveSlashingEvidence) 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) UpdateBabylonHeight

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

func (*Storage) UpdateEthHeight

func (s *Storage) UpdateEthHeight(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