test

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 21 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  = 21
	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            = sdk.NewRat(5, 100)
	ConsumptionFreezingPeriodSec int64 = 24 * 7 * 3600
	PostIntervalSec              int64 = 600
)

construct some global keys and addrs.

Functions

func CheckAllValidatorList

func CheckAllValidatorList(
	t *testing.T, accountName string, isInAllValidatorList bool, lb *app.LinoBlockchain)

CheckAllValidatorList - check if account is in all validator set or not

func CheckBalance

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

CheckBalance - check account balance

func CheckGlobalAllocation

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

CheckGlobalAllocation - check global allocation parameter

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 CheckValidatorDeposit

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

CheckValidatorDeposit - check validator deposit

func CreateAccount

func CreateAccount(
	t *testing.T, accountName string, lb *app.LinoBlockchain, seq int64,
	resetPriv, transactionPriv, appPriv secp256k1.PrivKeySecp256k1,
	numOfLino string)

CreateAccount - register account on test blockchain

func CreateTestPost

func CreateTestPost(
	t *testing.T, lb *app.LinoBlockchain,
	username, postID string, seq int64, priv secp256k1.PrivKeySecp256k1,
	sourceAuthor, sourcePostID string,
	parentAuthor, parentPostID string,
	redistributionSplitRate string, 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) *app.LinoBlockchain

func SignCheckDeliver

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

SignCheckDeliver - sign transaction, simulate and commit a block

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