types

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Please put all the test related function to here

Index

Constants

View Source
const (
	// ModuleName name of DDChain module
	ModuleName = "ddchain"
	// DefaultCodespace is the same as ModuleName
	DefaultCodespace = ModuleName
	// ReserveName the module account name to keep reserve
	ReserveName = "reserve"
	// AsgardName the module account name to keep asgard fund
	AsgardName = "asgard"
	// BondName the name of account used to store bond
	BondName = "bond"
	// LendingName
	LendingName = "lending"
	// AffiliateCollectorName the name of the account used to store karma for affiliate fee swaps
	AffiliateCollectorName = "affiliate_collector"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
	// RouterKey used in the RPC query
	RouterKey = ModuleName // this was defined in your key.go file
)
View Source
const (
	AddLiquidityEventType      = "add_liquidity"
	BondEventType              = "bond"
	DonateEventType            = "donate"
	ErrataEventType            = "errata"
	FeeEventType               = "fee"
	GasEventType               = "gas"
	OutboundEventType          = "outbound"
	PendingLiquidity           = "pending_liquidity"
	PoolBalanceChangeEventType = "pool_balance_change"
	PoolEventType              = "pool"
	RefundEventType            = "refund"
	ReserveEventType           = "reserve"
	RewardEventType            = "rewards"
	ScheduledOutboundEventType = "scheduled_outbound"
	SecurityEventType          = "security"
	SetMimirEventType          = "set_mimir"
	SetNodeMimirEventType      = "set_node_mimir"
	SlashEventType             = "slash"
	SlashPointEventType        = "slash_points"
	StreamingSwapEventType     = "streaming_swap"
	SwapEventType              = "swap"
	LimitOrderEventType        = "limit_order"
	MintBurnType               = "mint_burn"
	DDNameEventType            = "ddname"
	LoanOpenEventType          = "loan_open"
	LoanRepaymentEventType     = "loan_repayment"
	TSSKeygenMetricEventType   = "tss_keygen"
	TSSKeysignMetricEventType  = "tss_keysign"
	VersionEventType           = "version"
	WithdrawEventType          = "withdraw"
)

all event types support by DDChain

View Source
const (
	// SuperMajorityFactor - super majority 2/3
	SuperMajorityFactor = 3
	// SimpleMajorityFactor - simple majority 1/2
	SimpleMajorityFactor = 2
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default capability global index

View Source
const MaxAffiliateFeeBasisPoints = 1_000

MaxAffiliateFeeBasisPoints basis points for withdrawals

View Source
const MaxWithdrawBasisPoints = 10_000

MaxWithdrawBasisPoints basis points for withdrawals

View Source
const (
	// MinKeysharesBackupEntropy was selected based on a few spot checks of the entropy in
	// encrypted keyshares for mocknet, which were always greater than 7, this is just a
	// sanity check and is safe to set lower.
	MinKeysharesBackupEntropy float64 = 7
)
View Source
const (
	SwitchEventType = "switch"
)

Variables

View Source
var MatchMnemonic = regexp.MustCompile(`([a-zA-Z]+ ){11}[a-zA-Z]+`)

MatchMnemonic will match substrings that look like a 12+ word mnemonic.

View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func GetCurrentVersion

func GetCurrentVersion() semver.Version

GetCurrentVersion - intended for unit tests, fetches the current version of DDNode via `version` file #nosec G304 this is a method only used for test purpose

func GetRandomBCHAddress

func GetRandomBCHAddress() common.Address

func GetRandomBNBAddress

func GetRandomBNBAddress() common.Address

GetRandomBNBAddress will just create a random bnb address used for test purpose

func GetRandomBTCAddress

func GetRandomBTCAddress() common.Address

func GetRandomBech32Addr

func GetRandomBech32Addr() cosmos.AccAddress

GetRandomBech32Addr is an account address used for test

func GetRandomBech32ConsensusPubKey

func GetRandomBech32ConsensusPubKey() string

func GetRandomDDAddress

func GetRandomDDAddress() common.Address

GetRandomDDAddress will just create a random dd address used for test purpose

func GetRandomDOGEAddress

func GetRandomDOGEAddress() common.Address

func GetRandomETHAddress

func GetRandomETHAddress() common.Address

GetRandomETHAddress get a random ETH address for test purpose

func GetRandomGAIAAddress

func GetRandomGAIAAddress() common.Address

GetRandomGAIAAddress will just create a random terra address used for test purpose

func GetRandomKARMAAddress added in v0.2.3

func GetRandomKARMAAddress() common.Address

GetRandomKARMAAddress will just create a random karma address used for test purpose

func GetRandomLTCAddress

func GetRandomLTCAddress() common.Address

func GetRandomPubKey

func GetRandomPubKey() common.PubKey

func GetRandomPubKeySet

func GetRandomPubKeySet() common.PubKeySet

GetRandomPubKeySet return a random common.PubKeySet for test purpose

func GetRandomTERRAAddress

func GetRandomTERRAAddress() common.Address

GetRandomTERRAAddress will just create a random terra address used for test purpose

func GetRandomTx

func GetRandomTx() common.Tx

GetRandomTx

func GetRandomTxHash

func GetRandomTxHash() common.TxID

GetRandomTxHash create a random txHash used for test purpose

func GetThreshold

func GetThreshold(value int) (int, error)

GetThreshold calculate threshold

func HasMinority

func HasMinority(signers, total int) bool

HasMinority return true when it has more than 1/3

func HasSimpleMajority

func HasSimpleMajority(signers, total int) bool

HasSimpleMajority return true when it has more than 1/2 this method replace HasSimpleMajority, which is not correct

func HasSuperMajority

func HasSuperMajority(signers, total int) bool

HasSuperMajority return true when it has 2/3 majority

func MakeTestCodec

func MakeTestCodec() *codec.LegacyAmino

create a codec used only for testing

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

RegisterCodec register the msg types for amino

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces register the types

func SetupConfigForTest

func SetupConfigForTest()

SetupConfigForTest used for test purpose

Types

type DoneStage

type DoneStage struct {
	Completed bool `json:"completed"`
}

type InboundConfirmationCountedStage

type InboundConfirmationCountedStage struct {
	CountingStartHeight             int64        `json:"counting_start_height,omitempty"`
	Chain                           common.Chain `json:"chain,omitempty"`
	ExternalObservedHeight          int64        `json:"external_observed_height,omitempty"`
	ExternalConfirmationDelayHeight int64        `json:"external_confirmation_delay_height,omitempty"`
	RemainingConfirmationSeconds    *int64       `json:"remaining_confirmation_seconds,omitempty"`
	Completed                       bool         `json:"completed"`
}

Querier context contains the query's provided height, but not the full block context, so do not use BlockTime to provide a timestamp estimate.

type InboundObservedStage

type InboundObservedStage struct {
	Started   *bool `json:"started,omitempty"`
	Completed bool  `json:"completed"`
}

type LiquidityProviders

type LiquidityProviders []LiquidityProvider

LiquidityProviders a list of liquidity providers

type Loans

type Loans []Loan

Loans a list of loans

type NodeAccounts

type NodeAccounts []NodeAccount

NodeAccounts just a list of NodeAccount

func (NodeAccounts) Contains

func (nas NodeAccounts) Contains(na NodeAccount) bool

Contains will check whether the given node account is in the list

func (NodeAccounts) GetNodeAddresses

func (nas NodeAccounts) GetNodeAddresses() []cosmos.AccAddress

func (NodeAccounts) IsEmpty

func (nas NodeAccounts) IsEmpty() bool

IsEmpty to check whether the NodeAccounts is empty

func (NodeAccounts) IsNodeKeys

func (nas NodeAccounts) IsNodeKeys(addr cosmos.AccAddress) bool

IsNodeKeys validate whether the given account address belongs to an currently active validator

func (NodeAccounts) Len

func (nas NodeAccounts) Len() int

Len return the number of accounts in it

func (NodeAccounts) Less

func (nas NodeAccounts) Less(i, j int) bool

Less sort interface , it will sort by StatusSince field, and then by SignerBNBAddress

func (NodeAccounts) Swap

func (nas NodeAccounts) Swap(i, j int)

Swap node account

type ObservedTxVoters

type ObservedTxVoters []ObservedTxVoter

ObservedTxVoters a list of observed tx voter

type ObservedTxs

type ObservedTxs []ObservedTx

ObservedTxs a list of ObservedTx

func (ObservedTxs) Contains

func (txs ObservedTxs) Contains(tx ObservedTx) bool

type OutboundDelayStage

type OutboundDelayStage struct {
	RemainingDelayBlocks  *int64 `json:"remaining_delay_blocks,omitempty"`
	RemainingDelaySeconds *int64 `json:"remaining_delay_seconds,omitempty"`
	Completed             bool   `json:"completed"`
}

type OutboundSignedStage

type OutboundSignedStage struct {
	ScheduledOutboundHeight *int64 `json:"scheduled_outbound_height,omitempty"`
	BlocksSinceScheduled    *int64 `json:"blocks_since_scheduled,omitempty"`
	Completed               bool   `json:"completed"`
}

type PoolMods

type PoolMods []PoolMod

PoolMods a list of pool modifications

type Pools

type Pools []Pool

Pools represent a list of pools

func (Pools) Get

func (m Pools) Get(asset common.Asset) (Pool, bool)

func (Pools) Set

func (m Pools) Set(pool Pool) Pools

type QueryChainAddress

type QueryChainAddress struct {
	Chain   common.Chain   `json:"chain"`
	Address common.Address `json:"address"`
}

type QueryChainHeight

type QueryChainHeight struct {
	Chain  common.Chain `json:"chain"`
	Height int64        `json:"height"`
}

QueryChainHeight chain height

type QueryKeygenBlock

type QueryKeygenBlock struct {
	KeygenBlock KeygenBlock `json:"keygen_block"`
	Signature   string      `json:"signature"`
}

QueryKeygenBlock query keygen, displays signed keygen requests

func (QueryKeygenBlock) String

func (n QueryKeygenBlock) String() string

String implement fmt.Stringer

type QueryKeysign

type QueryKeysign struct {
	Keysign   TxOut  `json:"keysign"`
	Signature string `json:"signature"`
}

QueryKeysign query keysign result

type QueryLiquidityProvider

type QueryLiquidityProvider struct {
	Asset              common.Asset   `json:"asset"`
	KarmaAddress       common.Address `json:"karma_address,omitempty"`
	AssetAddress       common.Address `json:"asset_address,omitempty"`
	LastAddHeight      int64          `json:"last_add_height,omitempty"`
	LastWithdrawHeight int64          `json:"last_withdraw_height,omitempty"`
	Units              cosmos.Uint    `json:"units"`
	PendingKarma       cosmos.Uint    `json:"pending_karma"`
	PendingAsset       cosmos.Uint    `json:"pending_asset"`
	PendingTxId        string         `json:"pending_tx_id,omitempty"`
	KarmaDepositValue  cosmos.Uint    `json:"karma_deposit_value"`
	AssetDepositValue  cosmos.Uint    `json:"asset_deposit_value"`
	KarmaRedeemValue   cosmos.Uint    `json:"karma_redeem_value"`
	AssetRedeemValue   cosmos.Uint    `json:"asset_redeem_value"`
	LuviDepositValue   cosmos.Uint    `json:"luvi_deposit_value"`
	LuviRedeemValue    cosmos.Uint    `json:"luvi_redeem_value"`
	LuviGrowthPct      cosmos.Dec     `json:"luvi_growth_pct"`
}

QueryLiquidityProvider holds all the information related to a liquidity provider

func NewQueryLiquidityProvider

func NewQueryLiquidityProvider(lp LiquidityProvider, pool Pool, synthSupply cosmos.Uint, version semver.Version) QueryLiquidityProvider

NewQueryLiquidityProvider creates a new QueryLiquidityProvider based on the given liquidity provider and pool

type QueryNodeAccount

type QueryNodeAccount struct {
	NodeAddress         cosmos.AccAddress              `json:"node_address"`
	Status              NodeStatus                     `json:"status"`
	PubKeySet           common.PubKeySet               `json:"pub_key_set"`
	ValidatorConsPubKey string                         `json:"validator_cons_pub_key"`
	PeerID              string                         `json:"peer_id"`
	ActiveBlockHeight   int64                          `json:"active_block_height"`
	StatusSince         int64                          `json:"status_since"`
	NodeOperatorAddress common.Address                 `json:"node_operator_address"`
	TotalBond           cosmos.Uint                    `json:"total_bond"`
	BondProviders       BondProviders                  `json:"bond_providers"`
	SignerMembership    common.PubKeys                 `json:"signer_membership"`
	RequestedToLeave    bool                           `json:"requested_to_leave"`
	ForcedToLeave       bool                           `json:"forced_to_leave"`
	LeaveScore          uint64                         `json:"leave_height"`
	IPAddress           string                         `json:"ip_address"`
	Version             semver.Version                 `json:"version"`
	SlashPoints         int64                          `json:"slash_points"`
	Jail                Jail                           `json:"jail"`
	CurrentAward        cosmos.Uint                    `json:"current_award"`
	ObserveChains       []QueryChainHeight             `json:"observe_chains"`
	PreflightStatus     QueryNodeAccountPreflightCheck `json:"preflight_status"`
}

QueryNodeAccount hold all the information related to node account

func NewQueryNodeAccount

func NewQueryNodeAccount(na NodeAccount) QueryNodeAccount

NewQueryNodeAccount create a new QueryNodeAccount based on the given node account parameter

type QueryNodeAccountPreflightCheck

type QueryNodeAccountPreflightCheck struct {
	Status      NodeStatus `json:"status"`
	Description string     `json:"reason"`
	Code        int        `json:"code"`
}

QueryNodeAccountPreflightCheck is structure to hold all the information need to return to client include current node status , and whether it might get churned in next

func (QueryNodeAccountPreflightCheck) String

String implement fmt.Stringer

type QueryObservedTx

type QueryObservedTx struct {
	Tx                              common.Tx     `json:"tx"`
	Status                          Status        `json:"status,omitempty"`
	OutHashes                       []string      `json:"out_hashes,omitempty"`
	BlockHeight                     int64         `json:"block_height,omitempty"`
	ExternalObservedHeight          int64         `json:"external_observed_height,omitempty"`
	Signers                         []string      `json:"signers,omitempty"`
	ObservedPubKey                  common.PubKey `json:"observed_pub_key,omitempty"`
	KeysignMs                       int64         `json:"keysign_ms,omitempty"`
	FinaliseHeight                  int64         `json:"finalise_height,omitempty"`
	ExternalConfirmationDelayHeight int64         `json:"external_confirmation_delay_height,omitempty"`
	Aggregator                      string        `json:"aggregator,omitempty"`
	AggregatorTarget                string        `json:"aggregator_target,omitempty"`
	AggregatorTargetLimit           *cosmos.Uint  `json:"aggregator_target_limit,omitempty"`
}

QueryObservedTx holds all the information related to the ObservedTx

func NewQueryObservedTx

func NewQueryObservedTx(obTx ObservedTx) QueryObservedTx

NewQueryObservedTx create a new QueryObservedTx based on the given ObservedTx parameters

func (*QueryObservedTx) Valid

func (m *QueryObservedTx) Valid() error

Valid checks whether the QueryObservedTx represents valid information

type QueryPlannedOutTx

type QueryPlannedOutTx struct {
	Chain     common.Chain   `json:"chain"`
	ToAddress common.Address `json:"to_address"`
	Coin      common.Coin    `json:"coin"`
	Refund    bool           `json:"refund"`
}

func NewQueryPlannedOutTxs

func NewQueryPlannedOutTxs(outTxs ...TxOutItem) []QueryPlannedOutTx

type QueryPool

type QueryPool struct {
	Asset                string `json:"asset"`
	Status               string `json:"status"`
	Decimals             int64  `json:"decimals,omitempty"`
	PendingInboundAsset  string `json:"pending_inbound_asset"`
	PendingInboundKarma  string `json:"pending_inbound_karma"`
	BalanceAsset         string `json:"balance_asset"`
	BalanceKarma         string `json:"balance_karma"`
	PoolUnits            string `json:"pool_units"`
	LPUnits              string `json:"LP_units"`
	SynthUnits           string `json:"synth_units"`
	SynthSupply          string `json:"synth_supply"`
	SaversDepth          string `json:"savers_depth"`
	SaversUnits          string `json:"savers_units"`
	SynthMintPaused      bool   `json:"synth_mint_paused"`
	SynthSupplyRemaining string `json:"synth_supply_remaining"`
	LoanCollateral       string `json:"loan_collateral"`
}

QueryPool holds all the information related to a pool

func NewQueryPool

func NewQueryPool(pool Pool) QueryPool

NewQueryPool creates a new QueryPool based on the given pool parameters

type QueryQueue

type QueryQueue struct {
	Swap                   int64       `json:"swap"`
	Outbound               int64       `json:"outbound"`
	Internal               int64       `json:"internal"`
	ScheduledOutboundValue cosmos.Uint `json:"scheduled_outbound_value"`
}

QueryQueue a struct store the total outstanding out items

func (QueryQueue) String

func (h QueryQueue) String() string

String implement fmt.Stringer

type QueryResLastBlockHeights

type QueryResLastBlockHeights struct {
	Chain            common.Chain `json:"chain"`
	LastChainHeight  int64        `json:"last_observed_in"`
	LastSignedHeight int64        `json:"last_signed_out"`
	Ddchain          int64        `json:"ddchain"`
}

QueryResLastBlockHeights used to return the block height query

func (QueryResLastBlockHeights) String

func (h QueryResLastBlockHeights) String() string

String implement fmt.Stringer return a string representation of QueryResLastBlockHeights

type QuerySaver

type QuerySaver struct {
	Asset              common.Asset   `json:"asset"`
	AssetAddress       common.Address `json:"asset_address"`
	LastAddHeight      int64          `json:"last_add_height,omitempty"`
	LastWithdrawHeight int64          `json:"last_withdraw_height,omitempty"`
	Units              cosmos.Uint    `json:"units"`
	AssetDepositValue  cosmos.Uint    `json:"asset_deposit_value"`
	AssetRedeemValue   cosmos.Uint    `json:"asset_redeem_value"`
	GrowthPct          cosmos.Dec     `json:"growth_pct"`
}

QuerySaver holds all the information related to a saver

func NewQuerySaver

func NewQuerySaver(lp LiquidityProvider, pool Pool) QuerySaver

NewQuerySaver creates a new QuerySaver based on the given liquidity provider parameters and pool

type QueryTxOutItem

type QueryTxOutItem struct {
	Chain       common.Chain   `json:"chain"`
	ToAddress   common.Address `json:"to_address"`
	VaultPubKey common.PubKey  `json:"vault_pub_key,omitempty"`
	Coin        common.Coin    `json:"coin"`
	Memo        string         `json:"memo,omitempty"`
	MaxGas      common.Gas     `json:"max_gas"`
	GasRate     int64          `json:"gas_rate,omitempty"`
	InHash      common.TxID    `json:"in_hash,omitempty"`
	OutHash     common.TxID    `json:"out_hash,omitempty"`
	Height      int64          `json:"height"`
}

func NewQueryTxOutItem

func NewQueryTxOutItem(toi TxOutItem, height int64) QueryTxOutItem

NewQueryTxOutItem create a new QueryTxOutItem based on the given txout item parameter

type QueryTxSigners

type QueryTxSigners struct {
	TxID            common.TxID       `json:"tx_id,omitempty"`
	Tx              QueryObservedTx   `json:"tx"`
	Height          int64             `json:"height,omitempty"`
	Txs             []QueryObservedTx `json:"txs"`
	Actions         []TxOutItem       `json:"actions"`
	OutTxs          []common.Tx       `json:"out_txs"`
	FinalisedHeight int64             `json:"finalised_height,omitempty"`
	UpdatedVault    bool              `json:"updated_vault,omitempty"`
	Reverted        bool              `json:"reverted,omitempty"`
	OutboundHeight  int64             `json:"outbound_height,omitempty"`
}

func NewQueryTxSigners

func NewQueryTxSigners(voter ObservedTxVoter) QueryTxSigners

NewQueryTxSigners creates a new QueryTxSigners based on the given ObservedTxVoter parameters

func (*QueryTxSigners) Valid

func (m *QueryTxSigners) Valid() error

Valid checks whether the QueryTxSigners represents valid information

type QueryTxStages

type QueryTxStages struct {
	// Pointers so that the omitempty can recognise 'nil'.
	// Structs used for all stages for easier user looping through 'Completed' fields.
	InboundObserved            InboundObservedStage             `json:"inbound_observed"`
	InboundConfirmationCounted *InboundConfirmationCountedStage `json:"inbound_confirmation_counted,omitempty"`
	InboundFinalised           DoneStage                        `json:"inbound_finalised"`
	SwapFinalised              *DoneStage                       `json:"swap_finalised,omitempty"`
	OutboundDelay              *OutboundDelayStage              `json:"outbound_delay,omitempty"`
	OutboundSigned             *OutboundSignedStage             `json:"outbound_signed,omitempty"`
}

func NewQueryTxStages

func NewQueryTxStages(ctx cosmos.Context, voter ObservedTxVoter, isSwap, isPending bool) QueryTxStages

type QueryTxStatus

type QueryTxStatus struct {
	// A Tx pointer so that the omitempty can recognise 'nil'.
	Tx            *common.Tx          `json:"tx,omitempty"`
	PlannedOutTxs []QueryPlannedOutTx `json:"planned_out_txs,omitempty"`
	OutTxs        []common.Tx         `json:"out_txs,omitempty"`
	Stages        QueryTxStages       `json:"stages"`
}

func NewQueryTxStatus

func NewQueryTxStatus(ctx cosmos.Context, voter ObservedTxVoter, isSwap, isPending bool) QueryTxStatus

type QueryVaultPubKeyContract

type QueryVaultPubKeyContract struct {
	PubKey  common.PubKey   `json:"pub_key"`
	Routers []ChainContract `json:"routers"`
}

QueryVaultPubKeyContract is a type to combine PubKey and it's related contract

type QueryVaultResp

type QueryVaultResp struct {
	BlockHeight           int64                                   `json:"block_height,omitempty"`
	PubKey                gitlab_com_ddchain_ddnode_common.PubKey `json:"pub_key,omitempty"`
	Coins                 gitlab_com_ddchain_ddnode_common.Coins  `json:"coins"`
	Type                  VaultType                               `json:"type,omitempty"`
	Status                VaultStatus                             `json:"status,omitempty"`
	StatusSince           int64                                   `json:"status_since,omitempty"`
	Membership            []string                                `json:"membership,omitempty"`
	Chains                []string                                `json:"chains,omitempty"`
	InboundTxCount        int64                                   `json:"inbound_tx_count,omitempty"`
	OutboundTxCount       int64                                   `json:"outbound_tx_count,omitempty"`
	PendingTxBlockHeights []int64                                 `json:"pending_tx_block_heights,omitempty"`
	Routers               []ChainContract                         `json:"routers"`
	Addresses             []QueryChainAddress                     `json:"addresses"`
	Frozen                []string                                `json:"frozen,omitempty"`
}

QueryVaultResp used represent the informat return to client for query asgard

type QueryVaultsPubKeys

type QueryVaultsPubKeys struct {
	Asgard    []QueryVaultPubKeyContract `json:"asgard"`
	Yggdrasil []QueryVaultPubKeyContract `json:"yggdrasil"`
	Inactive  []QueryVaultPubKeyContract `json:"inactive"`
}

QueryVaultsPubKeys represent the result for query vaults pubkeys

type QueryVersion

type QueryVersion struct {
	Current         semver.Version `json:"current"`
	Next            semver.Version `json:"next"`
	NextSinceHeight int64          `json:"next_since_height,omitempty"` // Don't display this for heights when not yet stored (0).
	Querier         semver.Version `json:"querier"`
}

type QueryYggdrasilVaults

type QueryYggdrasilVaults struct {
	BlockHeight           int64                                   `json:"block_height,omitempty"`
	PubKey                gitlab_com_ddchain_ddnode_common.PubKey `json:"pub_key,omitempty"`
	Coins                 gitlab_com_ddchain_ddnode_common.Coins  `json:"coins"`
	Type                  VaultType                               `json:"type,omitempty"`
	StatusSince           int64                                   `json:"status_since,omitempty"`
	Membership            []string                                `json:"membership,omitempty"`
	Chains                []string                                `json:"chains,omitempty"`
	InboundTxCount        int64                                   `json:"inbound_tx_count,omitempty"`
	OutboundTxCount       int64                                   `json:"outbound_tx_count,omitempty"`
	PendingTxBlockHeights []int64                                 `json:"pending_tx_block_heights,omitempty"`
	Routers               []ChainContract                         `json:"routers"`
	Status                NodeStatus                              `json:"status"`
	Bond                  cosmos.Uint                             `json:"bond"`
	TotalValue            cosmos.Uint                             `json:"total_value"`
	Addresses             []QueryChainAddress                     `json:"addresses"`
}

QueryYggdrasilVaults query yggdrasil vault result

type ReserveContributors

type ReserveContributors []ReserveContributor

ReserveContributors a list of reserve contributors

func (ReserveContributors) Add

func (reses ReserveContributors) Add(res ReserveContributor) ReserveContributors

Add the given reserve contributor to list

type StreamingSwaps

type StreamingSwaps []StreamingSwap

type Vaults

type Vaults []Vault

Vaults a list of vault

func (Vaults) Has

func (vs Vaults) Has(target common.Coin) Vaults

Has return vaults that have that amount of coins in it

func (Vaults) HasAddress

func (vs Vaults) HasAddress(chain common.Chain, address common.Address) (bool, error)

HasAddress will go through the vaults to determinate whether any of the vault match the given address on the given chain

func (Vaults) SelectByMaxCoin

func (vs Vaults) SelectByMaxCoin(asset common.Asset) (vault Vault)

SelectByMaxCoin return the vault that has most of given asset

func (Vaults) SelectByMinCoin

func (vs Vaults) SelectByMinCoin(asset common.Asset) (vault Vault)

SelectByMinCoin return the vault that has least of given asset

func (Vaults) SortBy

func (vs Vaults) SortBy(sortBy common.Asset) Vaults

SortBy order coins by the given asset

Jump to

Keyboard shortcuts

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