Documentation ¶
Index ¶
- func AddKeysToWaitingList(accountsDB state.AccountsAdapter, waitingKeys [][]byte, ...)
- func AddStakingData(accountsDB state.AccountsAdapter, ownerAddress []byte, rewardAddress []byte, ...)
- func AddValidatorData(accountsDB state.AccountsAdapter, ownerKey []byte, registeredKeys [][]byte, ...)
- func CreateEconomicsData() process.EconomicsDataHandler
- func GetWaitingListElement(stakingSCAcc state.UserAccountHandler, marshaller marshal.Marshalizer, ...) (*systemSmartContracts.ElementInList, error)
- func LoadUserAccount(accountsDB state.AccountsAdapter, address []byte) state.UserAccountHandler
- func RegisterValidatorKeys(accountsDB state.AccountsAdapter, ownerAddress []byte, rewardAddress []byte, ...)
- func SaveDelegationManagerConfig(accountsDB state.AccountsAdapter, marshaller marshal.Marshalizer)
- func SaveNodesConfig(accountsDB state.AccountsAdapter, marshaller marshal.Marshalizer, ...)
- type AuctionListSelectorStub
- type StakingDataProviderStub
- func (sdps *StakingDataProviderStub) Clean()
- func (sdps *StakingDataProviderStub) ComputeUnQualifiedNodes(validatorInfos state.ShardValidatorsInfoMapHandler) ([][]byte, map[string][][]byte, error)
- func (sdps *StakingDataProviderStub) EpochConfirmed(uint32, uint64)
- func (sdps *StakingDataProviderStub) FillValidatorInfo(validator state.ValidatorInfoHandler) error
- func (sdps *StakingDataProviderStub) GetBlsKeyOwner(blsKey []byte) (string, error)
- func (sdps *StakingDataProviderStub) GetCurrentEpochValidatorStats() epochStart.ValidatorStatsInEpoch
- func (sdps *StakingDataProviderStub) GetNodeStakedTopUp(blsKey []byte) (*big.Int, error)
- func (sdps *StakingDataProviderStub) GetNumOfValidatorsInCurrentEpoch() uint32
- func (sdps *StakingDataProviderStub) GetOwnersData() map[string]*epochStart.OwnerData
- func (sdps *StakingDataProviderStub) GetTotalStakeEligibleNodes() *big.Int
- func (sdps *StakingDataProviderStub) GetTotalTopUpStakeEligibleNodes() *big.Int
- func (sdps *StakingDataProviderStub) IsInterfaceNil() bool
- func (sdps *StakingDataProviderStub) PrepareStakingData(validatorsMap state.ShardValidatorsInfoMapHandler) error
- type ValidatorsProviderStub
- func (vp *ValidatorsProviderStub) Close() error
- func (vp *ValidatorsProviderStub) ForceUpdate() error
- func (vp *ValidatorsProviderStub) GetAuctionList() ([]*common.AuctionListValidatorAPIResponse, error)
- func (vp *ValidatorsProviderStub) GetLatestValidators() map[string]*validator.ValidatorStatistics
- func (vp *ValidatorsProviderStub) IsInterfaceNil() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKeysToWaitingList ¶
func AddKeysToWaitingList( accountsDB state.AccountsAdapter, waitingKeys [][]byte, marshaller marshal.Marshalizer, rewardAddress []byte, ownerAddress []byte, )
AddKeysToWaitingList will add the owner's provided bls keys in the staking queue list
func AddStakingData ¶
func AddStakingData( accountsDB state.AccountsAdapter, ownerAddress []byte, rewardAddress []byte, stakedKeys [][]byte, marshaller marshal.Marshalizer, )
AddStakingData will add the owner's staked keys in the provided accounts db
func AddValidatorData ¶
func AddValidatorData( accountsDB state.AccountsAdapter, ownerKey []byte, registeredKeys [][]byte, totalStake *big.Int, marshaller marshal.Marshalizer, )
AddValidatorData will add the validator's registered keys in the provided accounts db
func CreateEconomicsData ¶
func CreateEconomicsData() process.EconomicsDataHandler
CreateEconomicsData returns an initialized process.EconomicsDataHandler
func GetWaitingListElement ¶
func GetWaitingListElement( stakingSCAcc state.UserAccountHandler, marshaller marshal.Marshalizer, key []byte, ) (*systemSmartContracts.ElementInList, error)
GetWaitingListElement returns the element in waiting list saved at the provided key
func LoadUserAccount ¶
func LoadUserAccount(accountsDB state.AccountsAdapter, address []byte) state.UserAccountHandler
LoadUserAccount returns address's state.UserAccountHandler from the provided db
func RegisterValidatorKeys ¶
func RegisterValidatorKeys( accountsDB state.AccountsAdapter, ownerAddress []byte, rewardAddress []byte, stakedKeys [][]byte, totalStake *big.Int, marshaller marshal.Marshalizer, )
RegisterValidatorKeys will register validator's staked key in the provided accounts db
func SaveDelegationManagerConfig ¶
func SaveDelegationManagerConfig(accountsDB state.AccountsAdapter, marshaller marshal.Marshalizer)
SaveDelegationManagerConfig will save a mock configuration for the delegation manager SC
func SaveNodesConfig ¶
func SaveNodesConfig( accountsDB state.AccountsAdapter, marshaller marshal.Marshalizer, stakedNodes, minNumNodes, maxNumNodes int64, )
SaveNodesConfig saves the nodes config in accounts db under "nodesConfig" key with provided params
Types ¶
type AuctionListSelectorStub ¶
type AuctionListSelectorStub struct {
SelectNodesFromAuctionListCalled func(validatorsInfoMap state.ShardValidatorsInfoMapHandler, randomness []byte) error
}
AuctionListSelectorStub -
func (*AuctionListSelectorStub) IsInterfaceNil ¶
func (als *AuctionListSelectorStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AuctionListSelectorStub) SelectNodesFromAuctionList ¶
func (als *AuctionListSelectorStub) SelectNodesFromAuctionList( validatorsInfoMap state.ShardValidatorsInfoMapHandler, randomness []byte, ) error
SelectNodesFromAuctionList -
type StakingDataProviderStub ¶
type StakingDataProviderStub struct { CleanCalled func() PrepareStakingDataCalled func(validatorsMap state.ShardValidatorsInfoMapHandler) error GetTotalStakeEligibleNodesCalled func() *big.Int GetTotalTopUpStakeEligibleNodesCalled func() *big.Int GetNodeStakedTopUpCalled func(blsKey []byte) (*big.Int, error) FillValidatorInfoCalled func(validator state.ValidatorInfoHandler) error ComputeUnQualifiedNodesCalled func(validatorInfos state.ShardValidatorsInfoMapHandler) ([][]byte, map[string][][]byte, error) GetBlsKeyOwnerCalled func(blsKey []byte) (string, error) GetOwnersDataCalled func() map[string]*epochStart.OwnerData }
StakingDataProviderStub -
func (*StakingDataProviderStub) ComputeUnQualifiedNodes ¶
func (sdps *StakingDataProviderStub) ComputeUnQualifiedNodes(validatorInfos state.ShardValidatorsInfoMapHandler) ([][]byte, map[string][][]byte, error)
ComputeUnQualifiedNodes -
func (*StakingDataProviderStub) EpochConfirmed ¶
func (sdps *StakingDataProviderStub) EpochConfirmed(uint32, uint64)
EpochConfirmed -
func (*StakingDataProviderStub) FillValidatorInfo ¶
func (sdps *StakingDataProviderStub) FillValidatorInfo(validator state.ValidatorInfoHandler) error
FillValidatorInfo -
func (*StakingDataProviderStub) GetBlsKeyOwner ¶
func (sdps *StakingDataProviderStub) GetBlsKeyOwner(blsKey []byte) (string, error)
GetBlsKeyOwner -
func (*StakingDataProviderStub) GetCurrentEpochValidatorStats ¶
func (sdps *StakingDataProviderStub) GetCurrentEpochValidatorStats() epochStart.ValidatorStatsInEpoch
GetCurrentEpochValidatorStats -
func (*StakingDataProviderStub) GetNodeStakedTopUp ¶
func (sdps *StakingDataProviderStub) GetNodeStakedTopUp(blsKey []byte) (*big.Int, error)
GetNodeStakedTopUp -
func (*StakingDataProviderStub) GetNumOfValidatorsInCurrentEpoch ¶
func (sdps *StakingDataProviderStub) GetNumOfValidatorsInCurrentEpoch() uint32
GetNumOfValidatorsInCurrentEpoch -
func (*StakingDataProviderStub) GetOwnersData ¶
func (sdps *StakingDataProviderStub) GetOwnersData() map[string]*epochStart.OwnerData
GetOwnersData -
func (*StakingDataProviderStub) GetTotalStakeEligibleNodes ¶
func (sdps *StakingDataProviderStub) GetTotalStakeEligibleNodes() *big.Int
GetTotalStakeEligibleNodes -
func (*StakingDataProviderStub) GetTotalTopUpStakeEligibleNodes ¶
func (sdps *StakingDataProviderStub) GetTotalTopUpStakeEligibleNodes() *big.Int
GetTotalTopUpStakeEligibleNodes -
func (*StakingDataProviderStub) IsInterfaceNil ¶
func (sdps *StakingDataProviderStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*StakingDataProviderStub) PrepareStakingData ¶
func (sdps *StakingDataProviderStub) PrepareStakingData(validatorsMap state.ShardValidatorsInfoMapHandler) error
PrepareStakingData -
type ValidatorsProviderStub ¶
type ValidatorsProviderStub struct { GetLatestValidatorsCalled func() map[string]*validator.ValidatorStatistics GetAuctionListCalled func() ([]*common.AuctionListValidatorAPIResponse, error) ForceUpdateCalled func() error }
ValidatorsProviderStub -
func (*ValidatorsProviderStub) ForceUpdate ¶
func (vp *ValidatorsProviderStub) ForceUpdate() error
ForceUpdate -
func (*ValidatorsProviderStub) GetAuctionList ¶
func (vp *ValidatorsProviderStub) GetAuctionList() ([]*common.AuctionListValidatorAPIResponse, error)
GetAuctionList -
func (*ValidatorsProviderStub) GetLatestValidators ¶
func (vp *ValidatorsProviderStub) GetLatestValidators() map[string]*validator.ValidatorStatistics
GetLatestValidators -
func (*ValidatorsProviderStub) IsInterfaceNil ¶
func (vp *ValidatorsProviderStub) IsInterfaceNil() bool
IsInterfaceNil -