Documentation ¶
Index ¶
- Constants
- func CreateBlock(blockchain *BlockChain, chainConfig *params.ChainConfig, ...) *types.Block
- func GetCandidateFromCurrentSmartContract(backend bind.ContractBackend, t *testing.T) masterNodes
- func GetSnapshotSigner(bc *BlockChain, header *types.Header) (signersList, error)
- func PrepareXDCTestBlockChainForV2Engine(t *testing.T, numOfBlocks int, chainConfig *params.ChainConfig, ...) (*BlockChain, *backends.SimulatedBackend, *types.Block, common.Address, ...)
- func PrepareXDCTestBlockChainWith128Candidates(t *testing.T, numOfBlocks int, chainConfig *params.ChainConfig) (*BlockChain, *backends.SimulatedBackend, *types.Block, common.Address, ...)
- func PrepareXDCTestBlockChainWithPenaltyForV2Engine(t *testing.T, numOfBlocks int, chainConfig *params.ChainConfig) (*BlockChain, *backends.SimulatedBackend, *types.Block, common.Address, ...)
- func RandStringBytes(n int) string
- func SignHashByPK(pk *ecdsa.PrivateKey, itemToSign []byte) []byte
- func UpdateSigner(bc *BlockChain) error
- type ForkedBlockOptions
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 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 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
}
Click to show internal directories.
Click to hide internal directories.