testutil

package
v0.0.0-...-169a2f2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlockByHeight

func GetBlockByHeight(node cluster.Node, height uint64) (*core.Block, error)

func GetBlockByHeightAll

func GetBlockByHeightAll(cls *cluster.Cluster, height uint64) map[int]*core.Block

func GetStatus

func GetStatus(node cluster.Node) (*consensus.Status, error)

func GetStatusAll

func GetStatusAll(cls *cluster.Cluster) map[int]*consensus.Status

func GetTxPoolStatus

func GetTxPoolStatus(node cluster.Node) (*txpool.Status, error)

func GetTxPoolStatusAll

func GetTxPoolStatusAll(cls *cluster.Cluster) map[int]*txpool.Status

func GetTxStatus

func GetTxStatus(node cluster.Node, hash []byte) (txpool.TxStatus, error)

func GetUnselectedIndexes

func GetUnselectedIndexes(total int, selected []int) []int

func PickUniqueRandoms

func PickUniqueRandoms(total, count int) []int

func QueryState

func QueryState(node cluster.Node, query *execution.QueryData) ([]byte, error)

func Sleep

func Sleep(d time.Duration)

Sleep print duration and call time.Sleep

func SubmitTx

func SubmitTx(cls *cluster.Cluster, tx *core.Transaction) (int, error)

func SubmitTxAndWait

func SubmitTxAndWait(cls *cluster.Cluster, tx *core.Transaction) (int, error)

func WaitTxCommited

func WaitTxCommited(node cluster.Node, tx *core.Transaction) error

Types

type JuriaCoinClient

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

func NewJuriaCoinClient

func NewJuriaCoinClient(mintCount, destCount int, binccPath string) *JuriaCoinClient

create and setup a LoadService submit chaincode deploy tx and wait for commit

func (*JuriaCoinClient) MakeBalanceQuery

func (client *JuriaCoinClient) MakeBalanceQuery(dest *core.PublicKey) *execution.QueryData

func (*JuriaCoinClient) MakeDeploymentTx

func (client *JuriaCoinClient) MakeDeploymentTx(minter *core.PrivateKey) *core.Transaction

func (*JuriaCoinClient) MakeMintTx

func (client *JuriaCoinClient) MakeMintTx(dest *core.PublicKey, value int64) *core.Transaction

func (*JuriaCoinClient) MakeTransferTx

func (client *JuriaCoinClient) MakeTransferTx(
	sender *core.PrivateKey, dest *core.PublicKey, value int64,
) *core.Transaction

func (*JuriaCoinClient) Mint

func (client *JuriaCoinClient) Mint(dest *core.PublicKey, value int64) error

func (*JuriaCoinClient) QueryBalance

func (client *JuriaCoinClient) QueryBalance(node cluster.Node, dest *core.PublicKey) (int64, error)

func (*JuriaCoinClient) SetupOnCluster

func (client *JuriaCoinClient) SetupOnCluster(cls *cluster.Cluster) error

func (*JuriaCoinClient) SubmitTx

func (client *JuriaCoinClient) SubmitTx() (int, *core.Transaction, error)

func (*JuriaCoinClient) SubmitTxAndWait

func (client *JuriaCoinClient) SubmitTxAndWait() (int, error)

type LoadClient

type LoadClient interface {
	SetupOnCluster(cls *cluster.Cluster) error
	SubmitTx() (int, *core.Transaction, error)
	SubmitTxAndWait() (int, error)
}

type LoadGenerator

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

func NewLoadGenerator

func NewLoadGenerator(tps int, client LoadClient) *LoadGenerator

func (*LoadGenerator) GetClient

func (lg *LoadGenerator) GetClient() LoadClient

func (*LoadGenerator) GetTxPerSec

func (lg *LoadGenerator) GetTxPerSec() int

func (*LoadGenerator) ResetTotalSubmitted

func (lg *LoadGenerator) ResetTotalSubmitted() int

func (*LoadGenerator) Run

func (lg *LoadGenerator) Run(ctx context.Context)

func (*LoadGenerator) SetupOnCluster

func (lg *LoadGenerator) SetupOnCluster(cls *cluster.Cluster) error

Jump to

Keyboard shortcuts

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