db

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEthereumTxToKafka added in v0.5.0

func AddEthereumTxToKafka(t EthereumTxToKafka) error

func AddIncomingEthereumTx added in v0.5.0

func AddIncomingEthereumTx(t IncomingEthereumTx) error

func AddIncomingTendermintTx added in v0.5.0

func AddIncomingTendermintTx(t IncomingTendermintTx) error

func AddKafkaEthereumConsume added in v0.6.0

func AddKafkaEthereumConsume(kafkaIndex int64, msgBytes [][]byte) (uint64, error)

func AddKafkaTendermintConsume added in v0.6.0

func AddKafkaTendermintConsume(kafkaIndex int64, msgBytes [][]byte) (uint64, error)

func AddTendermintTxToKafka added in v0.5.0

func AddTendermintTxToKafka(t TendermintTxToKafka) error

func CheckIncomingEthereumTxExists added in v0.5.0

func CheckIncomingEthereumTxExists(txHash common.Hash) bool

func CheckIncomingTendermintTxExists added in v0.5.0

func CheckIncomingTendermintTxExists(txHash tmBytes.HexBytes, msgIndex uint, denom string) bool

func CountTotalOutgoingTendermintTx added in v0.5.0

func CountTotalOutgoingTendermintTx() (int, error)

func DeleteAllValidators added in v0.4.1

func DeleteAllValidators() error

func DeleteEthereumTxToKafka added in v0.5.0

func DeleteEthereumTxToKafka(txHash common.Hash) error

func DeleteKafkaEthereumConsume added in v0.6.0

func DeleteKafkaEthereumConsume(index uint64) error

func DeleteKafkaTendermintConsume added in v0.6.0

func DeleteKafkaTendermintConsume(index uint64) error

func DeleteOutgoingEthereumTx added in v0.5.0

func DeleteOutgoingEthereumTx(txHash common.Hash) error

func DeleteOutgoingTendermintTx added in v0.5.0

func DeleteOutgoingTendermintTx(txHash string) error

func DeleteTendermintTxToKafka added in v0.5.0

func DeleteTendermintTxToKafka(txHash tmBytes.HexBytes, msgIndex uint, denom string) error

func DeleteValidator

func DeleteValidator(address sdk.ValAddress) error

func GetTotalTokensWrapped added in v0.3.1

func GetTotalTokensWrapped() (sdk.Int, error)

func InitializeDB

func InitializeDB(dbPath string, tendermintStart, ethereumStart int64) (*badger.DB, error)

func IterateOutgoingEthTx added in v0.5.0

func IterateOutgoingEthTx(operation func(key []byte, value []byte) error) error

func IterateOutgoingTmTx added in v0.5.0

func IterateOutgoingTmTx(operation func(key []byte, value []byte) error) error

func OpenDB

func OpenDB(dbPath string) (*badger.DB, error)

func SetAccountLimiter

func SetAccountLimiter(a AccountLimiter) error

func SetCosmosStatus

func SetCosmosStatus(height int64) error

func SetEthereumStatus

func SetEthereumStatus(height int64) error

func SetKafkaEthereumConsumeStatus added in v0.6.0

func SetKafkaEthereumConsumeStatus(height int64) error

func SetKafkaTendermintConsumeStatus added in v0.6.0

func SetKafkaTendermintConsumeStatus(height int64) error

func SetOutgoingEthereumTx added in v0.5.0

func SetOutgoingEthereumTx(ethTransaction OutgoingEthereumTransaction) error

func SetOutgoingTendermintTx added in v0.5.0

func SetOutgoingTendermintTx(tmTransaction OutgoingTendermintTransaction) error

func SetUnboundEpochTime

func SetUnboundEpochTime(epochTime int64) error

func SetValidator

func SetValidator(validator Validator) error

func UpdateKafkaEthereumConsumeTxHash added in v0.6.0

func UpdateKafkaEthereumConsumeTxHash(index uint64, txHash common.Hash) error

func UpdateKafkaTendermintConsumeTxHash added in v0.6.0

func UpdateKafkaTendermintConsumeTxHash(index uint64, txHash tmBytes.HexBytes) error

Types

type AccountLimiter

type AccountLimiter struct {
	AccountAddress sdk.AccAddress
	Amount         sdk.Int
}

func GetAccountLimiter

func GetAccountLimiter(address sdk.AccAddress) (AccountLimiter, error)

func (*AccountLimiter) Key

func (a *AccountLimiter) Key() []byte

func (*AccountLimiter) Validate

func (a *AccountLimiter) Validate() error

func (*AccountLimiter) Value

func (a *AccountLimiter) Value() ([]byte, error)

type DBI

type DBI interface {
	Key() []byte
	Value() ([]byte, error)
	Validate() error
	// contains filtered or unexported methods
}

type EthereumTxToKafka added in v0.5.0

type EthereumTxToKafka struct {
	TxHash common.Hash
}

func GetAllEthereumTxToKafka added in v0.5.0

func GetAllEthereumTxToKafka() ([]EthereumTxToKafka, error)

func (*EthereumTxToKafka) Key added in v0.5.0

func (t *EthereumTxToKafka) Key() []byte

func (*EthereumTxToKafka) Validate added in v0.5.0

func (t *EthereumTxToKafka) Validate() error

func (*EthereumTxToKafka) Value added in v0.5.0

func (t *EthereumTxToKafka) Value() ([]byte, error)

type IncomingEthereumTx added in v0.5.0

type IncomingEthereumTx struct {
	TxHash   common.Hash
	Sender   common.Address
	MsgBytes []byte
	MsgType  string
}

func GetIncomingEthereumTx added in v0.5.0

func GetIncomingEthereumTx(txHash common.Hash) (IncomingEthereumTx, error)

func (*IncomingEthereumTx) Key added in v0.5.0

func (t *IncomingEthereumTx) Key() []byte

func (*IncomingEthereumTx) Validate added in v0.5.0

func (t *IncomingEthereumTx) Validate() error

func (*IncomingEthereumTx) Value added in v0.5.0

func (t *IncomingEthereumTx) Value() ([]byte, error)

type IncomingTendermintTx added in v0.5.0

type IncomingTendermintTx struct {
	TxHash      tmBytes.HexBytes
	MsgIndex    uint
	Denom       string
	FromAddress string
	Amount      sdk.Int
	Memo        string
}

func GetIncomingTendermintTx added in v0.5.0

func GetIncomingTendermintTx(txHash tmBytes.HexBytes, msgIndex uint, denom string) (IncomingTendermintTx, error)

func (*IncomingTendermintTx) Key added in v0.5.0

func (t *IncomingTendermintTx) Key() []byte

func (*IncomingTendermintTx) Validate added in v0.5.0

func (t *IncomingTendermintTx) Validate() error

func (*IncomingTendermintTx) Value added in v0.5.0

func (t *IncomingTendermintTx) Value() ([]byte, error)

type KafkaEthereumConsume added in v0.6.0

type KafkaEthereumConsume struct {
	Index      uint64
	KafkaIndex int64
	MsgBytes   [][]byte
	TxHash     common.Hash
}

func GetEmptyTxHashesETH added in v0.6.0

func GetEmptyTxHashesETH() ([]KafkaEthereumConsume, error)

func GetKafkaEthereumConsume added in v0.6.0

func GetKafkaEthereumConsume(index uint64) (KafkaEthereumConsume, error)

func (KafkaEthereumConsume) Key added in v0.6.0

func (k KafkaEthereumConsume) Key() []byte

func (KafkaEthereumConsume) Validate added in v0.6.0

func (k KafkaEthereumConsume) Validate() error

func (KafkaEthereumConsume) Value added in v0.6.0

func (k KafkaEthereumConsume) Value() ([]byte, error)

type KafkaTendermintConsume added in v0.6.0

type KafkaTendermintConsume struct {
	Index      uint64
	KafkaIndex int64
	MsgBytes   [][]byte
	TxHash     tmBytes.HexBytes
}

func GetEmptyTxHashesTM added in v0.6.0

func GetEmptyTxHashesTM() ([]KafkaTendermintConsume, error)

func GetKafkaTendermintConsume added in v0.6.0

func GetKafkaTendermintConsume(index uint64) (KafkaTendermintConsume, error)

func (KafkaTendermintConsume) Key added in v0.6.0

func (k KafkaTendermintConsume) Key() []byte

func (KafkaTendermintConsume) Validate added in v0.6.0

func (k KafkaTendermintConsume) Validate() error

func (KafkaTendermintConsume) Value added in v0.6.0

func (k KafkaTendermintConsume) Value() ([]byte, error)

type OutgoingEthereumTransaction added in v0.5.0

type OutgoingEthereumTransaction struct {
	TxHash   common.Hash
	Messages []WrapTokenMsg
}

func NewOutgoingETHTransaction added in v0.5.0

func NewOutgoingETHTransaction(txHash common.Hash, msgs []WrapTokenMsg) OutgoingEthereumTransaction

func (*OutgoingEthereumTransaction) Key added in v0.5.0

func (ethTx *OutgoingEthereumTransaction) Key() []byte

func (*OutgoingEthereumTransaction) Validate added in v0.5.0

func (ethTx *OutgoingEthereumTransaction) Validate() error

func (*OutgoingEthereumTransaction) Value added in v0.5.0

func (ethTx *OutgoingEthereumTransaction) Value() ([]byte, error)

type OutgoingTendermintTransaction added in v0.5.0

type OutgoingTendermintTransaction struct {
	TxHash string
}

func NewOutgoingTMTransaction added in v0.5.0

func NewOutgoingTMTransaction(txHash string) OutgoingTendermintTransaction

func (*OutgoingTendermintTransaction) Key added in v0.5.0

func (tmTx *OutgoingTendermintTransaction) Key() []byte

func (*OutgoingTendermintTransaction) Validate added in v0.5.0

func (tmTx *OutgoingTendermintTransaction) Validate() error

func (*OutgoingTendermintTransaction) Value added in v0.5.0

func (tmTx *OutgoingTendermintTransaction) Value() ([]byte, error)

type Status

type Status struct {
	Name            string
	LastCheckHeight int64
}

func GetCosmosStatus

func GetCosmosStatus() (Status, error)

func GetEthereumStatus

func GetEthereumStatus() (Status, error)

func GetKafkaEthereumConsumeStatus added in v0.6.0

func GetKafkaEthereumConsumeStatus() (Status, error)

func GetKafkaTendermintConsumeStatus added in v0.6.0

func GetKafkaTendermintConsumeStatus() (Status, error)

func (*Status) Key

func (status *Status) Key() []byte

func (*Status) Validate

func (status *Status) Validate() error

func (*Status) Value

func (status *Status) Value() ([]byte, error)

type TendermintTxToKafka added in v0.5.0

type TendermintTxToKafka struct {
	TxHash   tmBytes.HexBytes
	MsgIndex uint
	Denom    string
}

func GetAllTendermintTxToKafka added in v0.5.0

func GetAllTendermintTxToKafka() ([]TendermintTxToKafka, error)

func (*TendermintTxToKafka) Key added in v0.5.0

func (t *TendermintTxToKafka) Key() []byte

func (*TendermintTxToKafka) Validate added in v0.5.0

func (t *TendermintTxToKafka) Validate() error

func (*TendermintTxToKafka) Value added in v0.5.0

func (t *TendermintTxToKafka) Value() ([]byte, error)

type UnboundEpochTime

type UnboundEpochTime struct {
	Epoch int64
}

func GetUnboundEpochTime

func GetUnboundEpochTime() (UnboundEpochTime, error)

func (*UnboundEpochTime) Key

func (u *UnboundEpochTime) Key() []byte

func (*UnboundEpochTime) Validate

func (u *UnboundEpochTime) Validate() error

func (*UnboundEpochTime) Value

func (u *UnboundEpochTime) Value() ([]byte, error)

type Validator

type Validator struct {
	Address sdk.ValAddress
	Name    string
}

func GetValidator

func GetValidator(address sdk.ValAddress) (Validator, error)

func GetValidators

func GetValidators() ([]Validator, error)

func (*Validator) Key

func (v *Validator) Key() []byte

func (*Validator) Validate

func (v *Validator) Validate() error

func (*Validator) Value

func (v *Validator) Value() ([]byte, error)

type WrapTokenMsg added in v0.6.0

type WrapTokenMsg struct {
	FromAddress      sdkTypes.AccAddress
	TendermintTxHash tmBytes.HexBytes
	Address          common.Address
	StakingAmount    *big.Int
	WrapAmount       *big.Int
}

func NewWrapTokenMsg added in v0.6.0

func NewWrapTokenMsg(fromAddress sdkTypes.AccAddress, tmTxHash tmBytes.HexBytes, stakingAmount *big.Int, ethAddress common.Address, wrapAmount *big.Int) WrapTokenMsg

func (WrapTokenMsg) Validate added in v0.6.0

func (w WrapTokenMsg) Validate() error

Jump to

Keyboard shortcuts

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