Documentation ¶
Index ¶
- Variables
- func CheckDelegationsEqual(ds1, ds2 staking.Delegations) error
- func CheckValidatorEqual(v1, v2 staking.Validator) error
- func CheckValidatorWrapperEqual(w1, w2 staking.ValidatorWrapper) error
- func CopyCommission(c staking.Commission) staking.Commission
- func CopyDelegation(d staking.Delegation) staking.Delegation
- func CopyDelegations(ds staking.Delegations) staking.Delegations
- func CopyUndelegation(ud staking.Undelegation) staking.Undelegation
- func CopyUndelegations(uds staking.Undelegations) staking.Undelegations
- func CopyValidator(v staking.Validator) staking.Validator
- func CopyValidatorWrapper(w staking.ValidatorWrapper) staking.ValidatorWrapper
- func CopyValidatorWrapperNoDelegations(w staking.ValidatorWrapper) staking.ValidatorWrapper
- func GetDefaultValidator() staking.Validator
- func GetDefaultValidatorWithAddr(addr common.Address, pubs []bls.SerializedPublicKey) staking.Validator
- func GetDefaultValidatorWrapper() staking.ValidatorWrapper
- func GetDefaultValidatorWrapperWithAddr(addr common.Address, pubs []bls.SerializedPublicKey) staking.ValidatorWrapper
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultDelAmount is the default delegation amount DefaultDelAmount = new(big.Int).Set(twentyKOnes) // DefaultMinSelfDel is the default value of MinSelfDelegation DefaultMinSelfDel = new(big.Int).Set(tenKOnes) // DefaultMaxTotalDel is the default value of MaxTotalDelegation DefaultMaxTotalDel = new(big.Int).Set(hundredKOnes) )
Functions ¶
func CheckDelegationsEqual ¶
func CheckDelegationsEqual(ds1, ds2 staking.Delegations) error
func CheckValidatorEqual ¶
CheckValidatorEqual checks the equality of validator. If not equal, an error is returned. Note nil pointer is treated as zero in this compare function.
func CheckValidatorWrapperEqual ¶
func CheckValidatorWrapperEqual(w1, w2 staking.ValidatorWrapper) error
CheckValidatorWrapperEqual checks the equality of staking.ValidatorWrapper. If not equal, an error is returned. Note nil pointer is treated as zero in this compare function.
func CopyCommission ¶
func CopyCommission(c staking.Commission) staking.Commission
CopyCommission deep copy the Commission
func CopyDelegation ¶
func CopyDelegation(d staking.Delegation) staking.Delegation
CopyDelegation copies staking.Delegation
func CopyDelegations ¶
func CopyDelegations(ds staking.Delegations) staking.Delegations
CopyDelegations deeps copy staking.Delegations
func CopyUndelegation ¶
func CopyUndelegation(ud staking.Undelegation) staking.Undelegation
CopyUndelegation deep copies staking.Undelegation
func CopyUndelegations ¶
func CopyUndelegations(uds staking.Undelegations) staking.Undelegations
CopyUndelegations deep copies staking.Undelegations
func CopyValidator ¶
CopyValidator deep copies staking.Validator
func CopyValidatorWrapper ¶
func CopyValidatorWrapper(w staking.ValidatorWrapper) staking.ValidatorWrapper
CopyValidatorWrapper deep copies staking.ValidatorWrapper
func CopyValidatorWrapperNoDelegations ¶
func CopyValidatorWrapperNoDelegations(w staking.ValidatorWrapper) staking.ValidatorWrapper
CopyValidatorWrapperNoDelegations deep copies staking.ValidatorWrapper, excluding Delegations With the heap pprof turned on, we see that copying validator wrapper is an expensive operation of which the most expensive part is copyng the delegations this function can be used when delegations are not expected to be changed by the caller
func GetDefaultValidator ¶
GetDefaultValidator return the default staking.Validator for testing
func GetDefaultValidatorWithAddr ¶
func GetDefaultValidatorWithAddr(addr common.Address, pubs []bls.SerializedPublicKey) staking.Validator
GetDefaultValidatorWithAddr return the default staking.Validator with the given validator address and bls keys
func GetDefaultValidatorWrapper ¶
func GetDefaultValidatorWrapper() staking.ValidatorWrapper
GetDefaultValidatorWrapper return the default staking.ValidatorWrapper for testing
func GetDefaultValidatorWrapperWithAddr ¶
func GetDefaultValidatorWrapperWithAddr(addr common.Address, pubs []bls.SerializedPublicKey) staking.ValidatorWrapper
GetDefaultValidatorWrapperWithAddr return the default staking.ValidatorWrapper with the given validator address and bls keys.
Types ¶
This section is empty.