constructor

package
v0.0.0-...-abdbe5d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 10 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

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) sdkmath.LegacyDec

Dec returns a sdk.Dec from a string

func LastCommitInfo

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

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

func MonitoringInfo

func MonitoringInfo(blockCount uint64, sc ...types.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) types.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 ...types.SignatureCount) types.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 CommitInfo

type CommitInfo struct {
	abci.CommitInfo
}

func (CommitInfo) Round

func (e CommitInfo) Round() int32

func (CommitInfo) Votes

func (e CommitInfo) Votes() comet.VoteInfos

type Validator

type Validator struct {
	abci.Validator
}

func (Validator) Address

func (v Validator) Address() []byte

func (Validator) Power

func (v Validator) Power() int64

type Vote

type Vote struct {
	Address []byte
	BlockID prototypes.BlockIDFlag
}

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

type VoteInfo

type VoteInfo struct {
	abci.VoteInfo
}

func (VoteInfo) GetBlockIDFlag

func (v VoteInfo) GetBlockIDFlag() comet.BlockIDFlag

func (VoteInfo) Validator

func (v VoteInfo) Validator() comet.Validator

type VoteInfos

type VoteInfos struct {
	// contains filtered or unexported fields
}

func (VoteInfos) Get

func (e VoteInfos) Get(i int) comet.VoteInfo

func (VoteInfos) Len

func (e VoteInfos) Len() int

Jump to

Keyboard shortcuts

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