testutil

package
v0.0.0-...-fb4f826 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchSubmitTx

func BatchSubmitTx(cls *cluster.Cluster, retryOrder []int, txs *core.TxList) (int, error)

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 PickUniqueRandoms

func PickUniqueRandoms(total, count int) []int

func QueryState

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

func Sleep

func Sleep(d time.Duration)

Sleep print duration and call time.Sleep

func SubmitTx

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

func SubmitTxAndWait

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

func WaitTxCommitted

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

Types

type EVMClient

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

func NewEVMClient

func NewEVMClient(nodes []int, contractPath string) *EVMClient

func (*EVMClient) BatchSubmitTx

func (client *EVMClient) BatchSubmitTx(num int) (int, *core.TxList, error)

func (*EVMClient) MakeDeploymentTx

func (client *EVMClient) MakeDeploymentTx() *core.Transaction

func (*EVMClient) MakeInvokeTx

func (client *EVMClient) MakeInvokeTx() *core.Transaction

func (*EVMClient) SetupOnCluster

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

func (*EVMClient) SubmitTx

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

func (*EVMClient) SubmitTxAndWait

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

type EmptyClient

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

func NewEmptyClient

func NewEmptyClient(nodes []int) *EmptyClient

func (*EmptyClient) BatchSubmitTx

func (client *EmptyClient) BatchSubmitTx(num int) (int, *core.TxList, error)

func (*EmptyClient) MakeDeploymentTx

func (client *EmptyClient) MakeDeploymentTx() *core.Transaction

func (*EmptyClient) MakeTx

func (client *EmptyClient) MakeTx() *core.Transaction

func (*EmptyClient) SetupOnCluster

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

func (*EmptyClient) SubmitTx

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

func (*EmptyClient) SubmitTxAndWait

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

type LoadClient

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

type LoadGenerator

type LoadGenerator struct {
	// contains filtered or unexported fields
}
var LoadGen *LoadGenerator

func NewLoadGenerator

func NewLoadGenerator(client LoadClient, tps int, jobs int) *LoadGenerator

func (*LoadGenerator) BatchRun

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

func (*LoadGenerator) GetClient

func (lg *LoadGenerator) GetClient() LoadClient

func (*LoadGenerator) Pause

func (lg *LoadGenerator) Pause()

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

func (*LoadGenerator) UnPause

func (lg *LoadGenerator) UnPause()

type PCoinClient

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

func NewPCoinClient

func NewPCoinClient(nodes []int, mintCount, destCount int, binccPath string) *PCoinClient

NewPCoinClient creates and setups a load service, submits chaincode deploy tx and waits for commission

func (*PCoinClient) BatchSubmitTx

func (client *PCoinClient) BatchSubmitTx(num int) (int, *core.TxList, error)

func (*PCoinClient) MakeBalanceQuery

func (client *PCoinClient) MakeBalanceQuery(dest *core.PublicKey) *common.QueryData

func (*PCoinClient) MakeDeploymentTx

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

func (*PCoinClient) MakeMintTx

func (client *PCoinClient) MakeMintTx(dest *core.PublicKey, value uint64) *core.Transaction

func (*PCoinClient) MakeTransferTx

func (client *PCoinClient) MakeTransferTx(sender *core.PrivateKey,
	dest *core.PublicKey, value uint64) *core.Transaction

func (*PCoinClient) Mint

func (client *PCoinClient) Mint(dest *core.PublicKey, value uint64) error

func (*PCoinClient) QueryBalance

func (client *PCoinClient) QueryBalance(node cluster.Node, dest *core.PublicKey) (uint64, error)

func (*PCoinClient) SetupOnCluster

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

func (*PCoinClient) SubmitTx

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

func (*PCoinClient) SubmitTxAndWait

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

Jump to

Keyboard shortcuts

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