constructor

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package constructor provides constructors to easily initialize objects for test purpose with automatic error handling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coin added in v0.3.0

func Coin(t testing.TB, str string) sdk.Coin

Coin returns a sdk.Coin from a string

func Coins

func Coins(t testing.TB, str string) sdk.Coins

Coins returns a sdk.Coins from a string

func Dec

func Dec(t testing.TB, str string) sdk.Dec

Dec returns a sdk.Dec from a string

func LastCommitInfo

func LastCommitInfo(votes ...Vote) abci.CommitInfo

LastCommitInfo creates a ABCI LastCommitInfo object for test purpose from a list of vote

func MonitoringInfo

func MonitoringInfo(blockCount uint64, sc ...spntypes.SignatureCount) (mi monitoringptypes.MonitoringInfo)

MonitoringInfo returns a monitoring info object for tests from a a block count and list of signature counts

func Shares

func Shares(t testing.TB, coinStr string) projecttypes.Shares

Shares returns a Shares object from a string of coin inputs

func SignatureCount

func SignatureCount(t testing.TB, opAddr string, relSig string) spntypes.SignatureCount

SignatureCount returns a signature count object for test from a operator address and a decimal string for relative signatures

func SignatureCounts

func SignatureCounts(blockCount uint64, sc ...spntypes.SignatureCount) spntypes.SignatureCounts

SignatureCounts returns a signature counts object for tests from a a block count and list of signature counts

func Vouchers

func Vouchers(t testing.TB, coinStr string, projectID uint64) sdk.Coins

Vouchers returns a Vouchers object from a string of coin inputs

Types

type Vote

type Vote struct {
	Address []byte
	Signed  bool
}

Vote is a simplified type for abci.VoteInfo for testing purpose

Jump to

Keyboard shortcuts

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