db

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEthereumTx

func DeleteEthereumTx(txHash common.Hash) error

func DeleteTendermintTx

func DeleteTendermintTx(txHash string) error

func DeleteValidator

func DeleteValidator(address sdk.ValAddress) error

func GetTotalEthBroadcastedTx

func GetTotalEthBroadcastedTx() (int, error)

func GetTotalTMBroadcastedTx

func GetTotalTMBroadcastedTx() (int, error)

func InitializeDB

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

func IterateEthTx

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

func IterateTmTx

func IterateTmTx(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 SetEthereumTx

func SetEthereumTx(ethTransaction EthereumBroadcastedWrapTokenTransaction) error

func SetTendermintTx

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