sample

package
v0.0.0-...-2da98db Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSample = errors.New("sample error")

Functions

func AccAddress

func AccAddress() string

AccAddress returns a sample account address in string

func AppState

func AppState(t *testing.T) map[string]json.RawMessage

func AssetRate

func AssetRate() types.AssetRate

func Authorization

func Authorization() authoritytypes.Authorization

func AuthorizationList

func AuthorizationList(val string) authoritytypes.AuthorizationList

func Ballot

func Ballot(t *testing.T, index string) *types.Ballot

func BallotList

func BallotList(n int, observerSet []string) []types.Ballot

func Bech32AccAddress

func Bech32AccAddress() sdk.AccAddress

Bech32AccAddress returns a sample account address

func BlameRecord

func BlameRecord(t *testing.T, index string) types.Blame

func BlameRecordsList

func BlameRecordsList(t *testing.T, n int) []types.Blame

func BlockHeader

func BlockHeader(blockHash []byte) proofs.BlockHeader

func BtcHash

func BtcHash() chainhash.Hash

BtcHash returns a sample btc hash

func Bytes

func Bytes() []byte

Bytes returns a sample byte array

func Chain

func Chain(chainID int64) chains.Chain

func ChainInfo

func ChainInfo(startChainID int64) authoritytypes.ChainInfo

func ChainNonces

func ChainNonces(t *testing.T, index string) types.ChainNonces

func ChainNoncesList

func ChainNoncesList(t *testing.T, n int) []types.ChainNonces

func ChainParams

func ChainParams(chainID int64) *types.ChainParams

func ChainParamsList

func ChainParamsList() (cpl types.ChainParamsList)

func ChainParamsSupported

func ChainParamsSupported(chainID int64) *types.ChainParams

func ChainState

func ChainState(chainID int64) lightclienttypes.ChainState

func Coins

func Coins() sdk.Coins

Coins returns a sample sdk.Coins

func CreateTempDir

func CreateTempDir(t *testing.T) string

create a temporary directory for testing

func CrossChainTx

func CrossChainTx(t *testing.T, index string) *types.CrossChainTx

func CrosschainFlags

func CrosschainFlags() *types.CrosschainFlags

func CustomAssetRate

func CustomAssetRate(
	chainID int64,
	asset string,
	decimals uint32,
	coinType coin.CoinType,
	rate sdk.Dec,
) types.AssetRate

CustomAssetRate creates a custom asset rate with the given parameters

func CustomCctxsInBlockRange

func CustomCctxsInBlockRange(
	t *testing.T,
	lowBlock uint64,
	highBlock uint64,
	senderChainID int64,
	receiverChainID int64,
	coinType coin.CoinType,
	asset string,
	amount uint64,
	status types.CctxStatus,
) (cctxs []*types.CrossChainTx)

CustomCctxsInBlockRange create 1 cctx per block in block range [lowBlock, highBlock] (inclusive)

func CustomRateLimiterFlags

func CustomRateLimiterFlags(
	enabled bool,
	window int64,
	rate math.Uint,
	conversions []types.Conversion,
) types.RateLimiterFlags

CustomRateLimiterFlags creates a custom rate limiter flags with the given parameters

func EthAddress

func EthAddress() ethcommon.Address

EthAddress returns a sample ethereum address

func EthTx

func EthTx(t *testing.T, chainID int64, to ethcommon.Address, nonce uint64) (*ethtypes.Transaction, []byte)

EthTx returns a sample ethereum transaction with the associated tx data bytes

func EthTxSigned

func EthTxSigned(
	t *testing.T,
	chainID int64,
	to ethcommon.Address,
	nonce uint64,
) (*ethtypes.Transaction, []byte, ethcommon.Address)

EthTxSigned returns a sample signed ethereum transaction with the address of the sender

func EventIndex

func EventIndex() uint64

func ForeignCoinList

func ForeignCoinList(t *testing.T, zrc20ETH, zrc20BTC, zrc20ERC20, erc20Asset string) []types.ForeignCoins

func ForeignCoins

func ForeignCoins(t *testing.T, address string) types.ForeignCoins

func GasPrice

func GasPrice(t *testing.T, index string) *types.GasPrice

func GasPriceIncreaseFlags

func GasPriceIncreaseFlags() types.GasPriceIncreaseFlags

func GenDoc

func GenDoc(t *testing.T) *types.GenesisDoc

func GetCctxIndexFromString

func GetCctxIndexFromString(index string) string

func GetInvalidZRC20WithdrawToExternal

func GetInvalidZRC20WithdrawToExternal(t *testing.T) (receipt ethtypes.Receipt)

receiver is 1EYVvXLusCxtVuEwoYvWRyN5EZTXwPVvo3

func GetValidZRC20WithdrawToBTC

func GetValidZRC20WithdrawToBTC(t *testing.T) (receipt ethtypes.Receipt)

receiver is bc1qysd4sp9q8my59ul9wsf5rvs9p387hf8vfwatzu

func GetValidZetaSentDestinationExternal

func GetValidZetaSentDestinationExternal(t *testing.T) (receipt ethtypes.Receipt)

func GetValidZrc20WithdrawToETH

func GetValidZrc20WithdrawToETH(t *testing.T) (receipt ethtypes.Receipt)

func Hash

func Hash() ethcommon.Hash

Hash returns a sample hash

func HeaderSupportedChains

func HeaderSupportedChains() []lightclienttypes.HeaderSupportedChain

func InboundHashToCctx

func InboundHashToCctx(t *testing.T, inboundHash string) types.InboundHashToCctx

func InboundParams

func InboundParams(r *rand.Rand) *types.InboundParams

func InboundParamsValidChainID

func InboundParamsValidChainID(r *rand.Rand) *types.InboundParams

func InboundTracker

func InboundTracker(t *testing.T, index string) types.InboundTracker

func InboundVote

func InboundVote(coinType coin.CoinType, from, to int64) types.MsgVoteInbound

func Int64InRange

func Int64InRange(low, high int64) int64

Int64InRange returns a sample int64 in the given ranges

func IntInRange

func IntInRange(low, high int64) sdkmath.Int

func Keygen

func Keygen(t *testing.T) *types.Keygen

func LastBlockHeight

func LastBlockHeight(t *testing.T, index string) *types.LastBlockHeight

func LastObserverCount

func LastObserverCount(lastChangeHeight int64) *types.LastObserverCount

func NodeAccount

func NodeAccount() *types.NodeAccount

func NonceToCCTX

func NonceToCCTX(t *testing.T, seed string) types.NonceToCctx

func NonceToCctxList

func NonceToCctxList(t *testing.T, index string, count int) []types.NonceToCctx

func ObserverSet

func ObserverSet(n int) types.ObserverSet

func OutboundParams

func OutboundParams(r *rand.Rand) *types.OutboundParams

func OutboundParamsValidChainID

func OutboundParamsValidChainID(r *rand.Rand) *types.OutboundParams

func OutboundTracker

func OutboundTracker(t *testing.T, index string) types.OutboundTracker

func PendingNoncesList

func PendingNoncesList(t *testing.T, index string, count int) []types.PendingNonces

func Policies

func Policies() authoritytypes.Policies

func PrivKeyAddressPair

func PrivKeyAddressPair() (*ed25519.PrivKey, sdk.AccAddress)

PrivKeyAddressPair returns a private key, address pair

func Proof

Proof generates a proof and block header returns the proof, block header, block hash, tx index, chain id, and tx hash

func PubKey

func PubKey(r *rand.Rand) cryptotypes.PubKey

PubKey returns a sample account PubKey

func PubKeySet

func PubKeySet() *crypto.PubKeySet

func PubKeyString

func PubKeyString() string

PubKeyString returns a sample public key string

func Rand

func Rand() *rand.Rand

Rand returns a new random number generator

func RateLimiterFlags

func RateLimiterFlags() types.RateLimiterFlags

func Status

func Status(t *testing.T, index string) *types.Status

func String

func String() string

String returns a sample string

func StringRandom

func StringRandom(r *rand.Rand, length int) string

StringRandom returns a sample string with random alphanumeric characters

func SystemContract

func SystemContract() *types.SystemContract

func Tss

func Tss() types.TSS

func TssFundsMigrator

func TssFundsMigrator(chainID int64) types.TssFundMigratorInfo

func TssList

func TssList(n int) (tssList []types.TSS)

func Uint64InRange

func Uint64InRange(low, high uint64) uint64

Uint64InRange returns a sample uint64 in the given ranges

func UintInRange

func UintInRange(low, high uint64) sdkmath.Uint

func ValAddress

func ValAddress(r *rand.Rand) sdk.ValAddress

ValAddress returns a sample validator operator address

func Validator

func Validator(t testing.TB, r *rand.Rand) stakingtypes.Validator

Validator returns a sample staking validator

func VotesSuccessOnly

func VotesSuccessOnly(voteCount int) []types.VoteType

func WithdrawableEmissions

func WithdrawableEmissions(t *testing.T) types.WithdrawableEmissions

func ZetaAccounting

func ZetaAccounting(t *testing.T, index string) types.ZetaAccounting

func ZetaIndex

func ZetaIndex(t *testing.T) string

Types

type MultipleSignerMessage

type MultipleSignerMessage struct{}

MultipleSignerMessage is a sample message which has two signers instead of one. This is used to test cases when we have checks for number of signers such as authorized transactions.

func (*MultipleSignerMessage) GetSigners

func (m *MultipleSignerMessage) GetSigners() []sdk.AccAddress

func (*MultipleSignerMessage) ProtoMessage

func (m *MultipleSignerMessage) ProtoMessage()

func (*MultipleSignerMessage) Reset

func (m *MultipleSignerMessage) Reset()

func (*MultipleSignerMessage) String

func (m *MultipleSignerMessage) String() string

func (*MultipleSignerMessage) ValidateBasic

func (m *MultipleSignerMessage) ValidateBasic() error

Jump to

Keyboard shortcuts

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