db

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToPendingEthereumIncomingTx added in v0.4.0

func AddToPendingEthereumIncomingTx(t EthereumIncomingTx) error

func AddToPendingTendermintIncomingTx added in v0.4.0

func AddToPendingTendermintIncomingTx(t TendermintIncomingTx) error

func CheckEthereumIncomingTxProduced added in v0.4.0

func CheckEthereumIncomingTxProduced(txHash common.Hash) bool

func CheckTendermintIncomingTxProduced added in v0.4.0

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

func DeleteBroadcastedEthereumTx added in v0.4.0

func DeleteBroadcastedEthereumTx(txHash common.Hash) error

func DeleteBroadcastedTendermintTx added in v0.4.0

func DeleteBroadcastedTendermintTx(txHash string) error

func DeleteValidator

func DeleteValidator(address sdk.ValAddress) error

func GetTotalTMBroadcastedTx

func GetTotalTMBroadcastedTx() (int, 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 IterateBroadcastedEthTx added in v0.4.0

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

func IterateBroadcastedTmTx added in v0.4.0

func IterateBroadcastedTmTx(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 SetBroadcastedEthereumTx added in v0.4.0

func SetBroadcastedEthereumTx(ethTransaction EthereumBroadcastedWrapTokenTransaction) error

func SetBroadcastedTendermintTx added in v0.4.0

func SetBroadcastedTendermintTx(tmTransaction TendermintBroadcastedTransaction) error

func SetCosmosStatus

func SetCosmosStatus(height int64) error

func SetEthereumIncomingTxProduced added in v0.4.0

func SetEthereumIncomingTxProduced(t EthereumIncomingTx) error

func SetEthereumStatus

func SetEthereumStatus(height int64) error

func SetTendermintIncomingTxProduced added in v0.4.0

func SetTendermintIncomingTxProduced(t TendermintIncomingTx) error

func SetUnboundEpochTime

func SetUnboundEpochTime(epochTime int64) error

func SetValidator

func SetValidator(validator Validator) error

Types

type AccountLimiter

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

func GetAccountLimiter

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

func GetAccountLimiterAndTotal

func GetAccountLimiterAndTotal(address sdk.AccAddress) (AccountLimiter, int)

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 EthereumBroadcastedWrapTokenTransaction

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

func (*EthereumBroadcastedWrapTokenTransaction) Key

func (*EthereumBroadcastedWrapTokenTransaction) Validate

func (*EthereumBroadcastedWrapTokenTransaction) Value

type EthereumIncomingTx added in v0.4.0

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

func GetEthereumIncomingTx added in v0.4.0

func GetEthereumIncomingTx(txHash common.Hash, producedToKafka bool) (EthereumIncomingTx, error)

func GetProduceToKafkaEthereumIncomingTx added in v0.4.0

func GetProduceToKafkaEthereumIncomingTx() ([]EthereumIncomingTx, error)

func (*EthereumIncomingTx) Key added in v0.4.0

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

func (*EthereumIncomingTx) Validate added in v0.4.0

func (t *EthereumIncomingTx) Validate() error

func (*EthereumIncomingTx) Value added in v0.4.0

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

type Status

type Status struct {
	Name            string
	LastCheckHeight int64 //TODO change it to Index
}

func GetCosmosStatus

func GetCosmosStatus() (Status, error)

func GetEthereumStatus

func GetEthereumStatus() (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 TendermintBroadcastedTransaction

type TendermintBroadcastedTransaction struct {
	TxHash string
}

func NewTMTransaction

func NewTMTransaction(txHash string) TendermintBroadcastedTransaction

func (*TendermintBroadcastedTransaction) Key

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

func (*TendermintBroadcastedTransaction) Validate

func (tmTx *TendermintBroadcastedTransaction) Validate() error

func (*TendermintBroadcastedTransaction) Value

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

type TendermintIncomingTx added in v0.4.0

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

func GetProduceToKafkaTendermintIncomingTxs added in v0.4.0

func GetProduceToKafkaTendermintIncomingTxs() ([]TendermintIncomingTx, error)

func GetTendermintIncomingTx added in v0.4.0

func GetTendermintIncomingTx(txHash tmBytes.HexBytes, msgIndex uint, producedToKafka bool, denom string) (TendermintIncomingTx, error)

func (*TendermintIncomingTx) Key added in v0.4.0

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

func (*TendermintIncomingTx) Validate added in v0.4.0

func (t *TendermintIncomingTx) Validate() error

func (*TendermintIncomingTx) Value added in v0.4.0

func (t *TendermintIncomingTx) 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)

Jump to

Keyboard shortcuts

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