test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 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  int       = 21
	GenesisTotalLino types.LNO = "10000000000"
	LNOPerValidator  types.LNO = "100000000"

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

	ProposalDecideHr            int64   = 24 * 7
	ParamChangeHr               int64   = 24
	CoinReturnIntervalHr        int64   = 24 * 7
	CoinReturnTimes             int64   = 7
	ConsumptionFrictionRate     sdk.Rat = sdk.NewRat(5, 100)
	ConsumptionFreezingPeriodHr int64   = 24 * 7
)

construct some global keys and addrs.

Functions

func CheckAllValidatorList

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

func CheckBalance

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

func CheckGlobalAllocation

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

func CheckOncallValidatorList

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

func CheckValidatorDeposit

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

func CoinToString

func CoinToString(coin types.Coin) string

func CreateAccount

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

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)

func GetGenesisAccountCoin

func GetGenesisAccountCoin(numOfValidator int) types.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)

func SimulateOneBlock

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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