engine_v2_tests

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const GAP = int(450)

Variables

This section is empty.

Functions

func CreateBlock

func CreateBlock(blockchain *BlockChain, chainConfig *params.ChainConfig, startingBlock *types.Block, blockNumber int, roundNumber int64, blockCoinBase string, signer common.Address, signFn func(account accounts.Account, hash []byte) ([]byte, error), penalties []byte, signersKey []*ecdsa.PrivateKey, merkleRoot string) *types.Block

func GetCandidateFromCurrentSmartContract

func GetCandidateFromCurrentSmartContract(backend bind.ContractBackend, t *testing.T) masterNodes

func GetSnapshotSigner

func GetSnapshotSigner(bc *BlockChain, header *types.Header) (signersList, error)

func PrepareXDCTestBlockChainForV2Engine

func PrepareXDCTestBlockChainForV2Engine(t *testing.T, numOfBlocks int, chainConfig *params.ChainConfig, forkedBlockOptions *ForkedBlockOptions) (*BlockChain, *backends.SimulatedBackend, *types.Block, common.Address, func(account accounts.Account, hash []byte) ([]byte, error), *types.Block)

V2 concensus engine

func PrepareXDCTestBlockChainWith128Candidates

func PrepareXDCTestBlockChainWith128Candidates(t *testing.T, numOfBlocks int, chainConfig *params.ChainConfig) (*BlockChain, *backends.SimulatedBackend, *types.Block, common.Address, func(account accounts.Account, hash []byte) ([]byte, error))

V2 concensus engine, compared to PrepareXDCTestBlockChainForV2Engine: (1) no forking (2) 128 masternode candidates

func PrepareXDCTestBlockChainWithPenaltyForV2Engine

func PrepareXDCTestBlockChainWithPenaltyForV2Engine(t *testing.T, numOfBlocks int, chainConfig *params.ChainConfig) (*BlockChain, *backends.SimulatedBackend, *types.Block, common.Address, func(account accounts.Account, hash []byte) ([]byte, error))

V2 concensus engine, compared to PrepareXDCTestBlockChainForV2Engine: (1) no forking (2) add penalty

func RandStringBytes

func RandStringBytes(n int) string

func SignHashByPK

func SignHashByPK(pk *ecdsa.PrivateKey, itemToSign []byte) []byte

func UpdateSigner

func UpdateSigner(bc *BlockChain) error

Types

type ForkedBlockOptions

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

Jump to

Keyboard shortcuts

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