test

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GenesisUser            = "genesis"
	GenesisPriv            = secp256k1.GenPrivKey()
	GenesisTransactionPriv = secp256k1.GenPrivKey()
	GenesisAppPriv         = secp256k1.GenPrivKey()
	GenesisAddr            = GenesisPriv.PubKey().Address()

	DefaultNumOfVal  = 22
	GenesisTotalCoin = types.NewCoinFromInt64(10000000000 * types.Decimals)
	CoinPerValidator = types.NewCoinFromInt64(100000000 * types.Decimals)

	PenaltyMissVote       = types.NewCoinFromInt64(20000 * types.Decimals)
	ChangeParamMinDeposit = types.NewCoinFromInt64(100000 * types.Decimals)

	ProposalDecideSec            int64 = 24 * 7 * 3600
	ParamChangeExecutionSec      int64 = 24 * 3600
	CoinReturnIntervalSec        int64 = 24 * 7 * 3600
	CoinReturnTimes              int64 = 7
	ConsumptionFrictionRate            = types.NewDecFromRat(5, 100)
	ConsumptionFreezingPeriodSec int64 = 24 * 7 * 3600
	PostIntervalSec              int64 = 600
)

construct some global keys and addrs.

Functions

func CheckAccountInfo added in v0.4.0

func CheckAccountInfo(t *testing.T, accountName string, lb *app.LinoBlockchain, expectInfo accmodel.AccountInfo)

CheckAccountInfo - check account balance

func CheckAppBandwidthInfo added in v0.3.0

func CheckAppBandwidthInfo(
	t *testing.T, info bandwidthmodel.AppBandwidthInfo, username types.AccountKey, lb *app.LinoBlockchain)

CheckAppBandwidthInfo

func CheckBalance

func CheckBalance(t *testing.T, accountName string, lb *app.LinoBlockchain, expectBalance types.Coin)

CheckBalance - check account balance

func CheckCurBlockInfo added in v0.3.0

func CheckCurBlockInfo(
	t *testing.T, info bandwidthmodel.BlockInfo, lb *app.LinoBlockchain)

CheckCurBlockInfo

func CheckGlobalAllocation

func CheckGlobalAllocation(t *testing.T, lb *app.LinoBlockchain, expectAllocation param.GlobalAllocationParam)

CheckGlobalAllocation - check global allocation parameter

func CheckJailValidatorList added in v0.4.0

func CheckJailValidatorList(
	t *testing.T, accountName string, isInJailValidatorList bool, lb *app.LinoBlockchain)

func CheckOncallValidatorList

func CheckOncallValidatorList(
	t *testing.T, accountName string, isInOnCallValidatorList bool, lb *app.LinoBlockchain)

CheckOncallValidatorList - check if account is in oncall validator set or not

func CheckReceivedVotes added in v0.4.0

func CheckReceivedVotes(
	t *testing.T, accountName string, votes types.Coin, lb *app.LinoBlockchain)

func CheckStandbyValidatorList added in v0.4.0

func CheckStandbyValidatorList(
	t *testing.T, accountName string, isInStandbyValidatorList bool, lb *app.LinoBlockchain)

func CreateAccount

func CreateAccount(
	t *testing.T, accountName string, lb *app.LinoBlockchain, seq uint64,
	txPriv, signPriv secp256k1.PrivKeySecp256k1,
	numOfLino string)

CreateAccount - register account on test blockchain

func CreateAccountWithTime added in v0.3.2

func CreateAccountWithTime(
	t *testing.T, accountName string, lb *app.LinoBlockchain, seq uint64,
	txPriv, signPriv secp256k1.PrivKeySecp256k1,
	numOfLino string, blockTime int64)

CreateAccountWithTime - register account on test blockchain

func CreateTestPost

func CreateTestPost(
	t *testing.T, lb *app.LinoBlockchain,
	username, postID string, seq uint64, priv secp256k1.PrivKeySecp256k1, publishTime int64)

CreateTestPost - create a test post

func GetGenesisAccountCoin

func GetGenesisAccountCoin(numOfValidator int) types.Coin

GetGenesisAccountCoin - get genesis account coin

func NewTestLinoBlockchain

func NewTestLinoBlockchain(t *testing.T, numOfValidators int, beginBlockTime time.Time) *app.LinoBlockchain

func RepeatSignCheckDeliver added in v0.3.0

func RepeatSignCheckDeliver(t *testing.T, lb *app.LinoBlockchain, msg sdk.Msg, seq uint64,
	expPass bool, priv secp256k1.PrivKeySecp256k1, headTime int64, times int)

RepeatSignCheckDeliver - sign same transaction repeatly, simulate and commit a block

func SignCheckDeliver

func SignCheckDeliver(t *testing.T, lb *app.LinoBlockchain, msg sdk.Msg, seq uint64,
	expPass bool, priv secp256k1.PrivKeySecp256k1, headTime int64)

SignCheckDeliver - sign transaction, simulate and commit a block

func SignCheckDeliverWithFee added in v0.3.0

func SignCheckDeliverWithFee(t *testing.T, lb *app.LinoBlockchain, msg sdk.Msg, seq uint64,
	expPass bool, priv secp256k1.PrivKeySecp256k1, headTime int64, fee auth.StdFee)

SignCheckDeliverWithFee - sign transaction with fee, simulate and commit a block

func SignCheckDeliverWithMultiSig added in v0.4.0

func SignCheckDeliverWithMultiSig(
	t *testing.T, lb *app.LinoBlockchain, msg sdk.Msg, seqs []uint64,
	expPass bool, privs []secp256k1.PrivKeySecp256k1, headTime int64)

SignCheckDeliverWithMultiSig - sign transaction with multi sig, simulate and commit a block

func SignCheckTxFail added in v0.6.0

func SignCheckTxFail(t *testing.T, lb *app.LinoBlockchain, msg sdk.Msg, seq uint64, priv secp256k1.PrivKeySecp256k1)

SignCheckTxShouldFail - sign transaction, it's checkTx should fail

func SimulateOneBlock

func SimulateOneBlock(lb *app.LinoBlockchain, headTime int64)

SimulateOneBlock - simulate a empty block and commit

Types

This section is empty.

Jump to

Keyboard shortcuts

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