testutil

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package testutil contains testutils.

Index

Constants

View Source
const (
	// AnomDenom is anom name .
	AnomDenom = "anom"
	// WnomERC20Address is wnom eth address .
	WnomERC20Address = "0xe7c0fd1f0A3f600C1799CD8d335D31efBE90592C"

	// ChainName is default test chain name.
	ChainName = "chain-1"
	// ChainFlag is default chain flag.
	ChainFlag = "--chain-id=" + ChainName
	// KeyRingFlag is default keyring flag.
	KeyRingFlag = "--keyring-backend=test"

	// ChainDenom is default chain denom.
	ChainDenom = AnomDenom
	// MinGlobalSelfDelegation is the value for app_state.staking.params.min_global_self_delegation.
	MinGlobalSelfDelegation = "250000000000000000000000" // 250k noms
	// MinSelfDelegationFlag is the generic min-self-delegation for a validator.
	MinSelfDelegationFlag = "--min-self-delegation=" + MinGlobalSelfDelegation
	// ValidatorGenesysAmount is default validator genesys amount.
	ValidatorGenesysAmount = "1000000000000000000000000" + ChainDenom // 1m noms
	// TestChainValidatorStakeAmount is default validator genesys stake amount.
	TestChainValidatorStakeAmount = MinGlobalSelfDelegation + ChainDenom
	// TestChainValidator1Name is default validator name.
	TestChainValidator1Name = "validator1"
	// TestChainValidator1EthAddress is default validator eth pub key.
	TestChainValidator1EthAddress = "0x2d9480eBA3A001033a0B8c3Df26039FD3433D55d"

	// OnomyGrpcHost is default host.
	OnomyGrpcHost = "127.0.0.1"
	// OnomyGrpcPort is default port.
	OnomyGrpcPort = "9090"
)
View Source
const DefaultRetryTimeout = time.Second

DefaultRetryTimeout is the default timeout used for retry.

Variables

This section is empty.

Functions

func AwaitForPort

func AwaitForPort(host, port string, timeout time.Duration) error

AwaitForPort awaits for the port within the timeout.

func ExecuteChainCmd

func ExecuteChainCmd(cmd string, args ...string) string

ExecuteChainCmd executes any cmd on the onomyd cli.

func RetryWithTimeout

func RetryWithTimeout(operation func() error, timeout time.Duration) error

RetryWithTimeout retries the operation within the timout.

Types

type OnomyChain

type OnomyChain struct {
	Validator keyring.KeyOutput
	// contains filtered or unexported fields
}

OnomyChain is test struct for the chain running.

func NewOnomyChain

func NewOnomyChain() (*OnomyChain, error)

NewOnomyChain creates a new OnomyChain.

func (*OnomyChain) GetAccountBalance

func (oc *OnomyChain) GetAccountBalance(address string) ([]sdkTypes.Coin, error)

GetAccountBalance return the 'address' balance.

func (*OnomyChain) Start

func (oc *OnomyChain) Start(timeout time.Duration) error

Start start the OnomyChain.

func (*OnomyChain) Stop

func (oc *OnomyChain) Stop()

Stop stops the OnomyChain.

Jump to

Keyboard shortcuts

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