staking

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: GPL-3.0 Imports: 82 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitialNodesConfig

type InitialNodesConfig struct {
	Owners                        map[string]*OwnerStats
	MaxNodesChangeConfig          []config.MaxNodesChangeConfig
	NumOfShards                   uint32
	MinNumberOfEligibleShardNodes uint32
	MinNumberOfEligibleMetaNodes  uint32
	ShardConsensusGroupSize       int
	MetaConsensusGroupSize        int
}

InitialNodesConfig -

type NodesRegisterData

type NodesRegisterData struct {
	BLSKeys    [][]byte
	TotalStake *big.Int
}

NodesRegisterData -

type OwnerStats

type OwnerStats struct {
	EligibleBlsKeys  map[uint32][][]byte
	WaitingBlsKeys   map[uint32][][]byte
	StakingQueueKeys [][]byte
	TotalStake       *big.Int
}

OwnerStats -

type TestMetaProcessor

type TestMetaProcessor struct {
	MetaBlockProcessor  process.BlockProcessor
	NodesCoordinator    nodesCoordinator.NodesCoordinator
	ValidatorStatistics process.ValidatorStatisticsProcessor
	EpochStartTrigger   integrationTests.TestEpochStartTrigger
	BlockChainHandler   data.ChainHandler
	NodesConfig         nodesConfig
	AccountsAdapter     state.AccountsAdapter
	Marshaller          marshal.Marshalizer
	TxCacher            dataRetriever.TransactionCacher
	TxCoordinator       process.TransactionCoordinator
	SystemVM            vmcommon.VMExecutionHandler
	BlockChainHook      process.BlockChainHookHandler
	StakingDataProvider epochStart.StakingDataProvider
	// contains filtered or unexported fields
}

TestMetaProcessor -

func NewTestMetaProcessor

func NewTestMetaProcessor(
	numOfMetaNodes uint32,
	numOfShards uint32,
	numOfEligibleNodesPerShard uint32,
	numOfWaitingNodesPerShard uint32,
	numOfNodesToShufflePerShard uint32,
	shardConsensusGroupSize int,
	metaConsensusGroupSize int,
	numOfNodesInStakingQueue uint32,
) *TestMetaProcessor

NewTestMetaProcessor -

func NewTestMetaProcessorWithCustomNodes

func NewTestMetaProcessorWithCustomNodes(config *InitialNodesConfig) *TestMetaProcessor

NewTestMetaProcessorWithCustomNodes -

func (*TestMetaProcessor) ClearStoredMbs

func (tmp *TestMetaProcessor) ClearStoredMbs()

ClearStoredMbs clears the stored miniblocks

func (*TestMetaProcessor) Process

func (tmp *TestMetaProcessor) Process(t *testing.T, numOfRounds uint64)

Process -

func (*TestMetaProcessor) ProcessJail

func (tmp *TestMetaProcessor) ProcessJail(t *testing.T, blsKeys [][]byte)

ProcessJail will create a block containing mini blocks with jail txs using provided nodes. Block will be committed + call to validator system sc will be made to jail all nodes

func (*TestMetaProcessor) ProcessReStake

func (tmp *TestMetaProcessor) ProcessReStake(t *testing.T, blsKeys [][]byte)

ProcessReStake will create a block containing mini blocks with re-staking txs using provided nodes. Block will be committed + call to validator system sc will be made to stake all nodes

func (*TestMetaProcessor) ProcessStake

func (tmp *TestMetaProcessor) ProcessStake(t *testing.T, nodes map[string]*NodesRegisterData)

ProcessStake will create a block containing mini blocks with staking txs using provided nodes. Block will be committed + call to validator system sc will be made to stake all nodes

func (*TestMetaProcessor) ProcessUnJail

func (tmp *TestMetaProcessor) ProcessUnJail(t *testing.T, blsKeys [][]byte)

ProcessUnJail will create a block containing mini blocks with unJail txs using provided nodes. Block will be committed + call to validator system sc will be made to unJail all nodes

func (*TestMetaProcessor) ProcessUnStake

func (tmp *TestMetaProcessor) ProcessUnStake(t *testing.T, nodes map[string][][]byte)

ProcessUnStake will create a block containing mini blocks with unStaking txs using provided nodes. Block will be committed + call to validator system sc will be made to unStake all nodes

Jump to

Keyboard shortcuts

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