staketest

package
v0.0.0-...-3a5d5d8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func CheckValidatorEqual(v1, v2 staking.Validator) error

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

func CopyValidator(v staking.Validator) staking.Validator

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

func GetDefaultValidator() staking.Validator

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.

Jump to

Keyboard shortcuts

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