delegation

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelegationAmount added in v0.14.4

type DelegationAmount struct {
	Address keys.Address    `json:"address"`
	Amount  *balance.Amount `json:"amount"`
}

-----------------------------Dump/Load chain state

type DelegationState added in v0.14.4

type DelegationState struct {
	ValidatorAmounts           []*DelegationAmount          `json:"validatorAmounts"`
	ValidatorDelegationAmounts []*ValidatorDelegationAmount `json:"validatorDelegationAmounts"`
	DelegatorEffectiveAmounts  []*DelegationAmount          `json:"delegatorEffectiveAmounts"`
	DelegatorBoundedAmounts    []*DelegationAmount          `json:"delegatorBoundedAmounts"`
	MatureAmounts              []*MatureData                `json:"matureAmounts"`
}

func NewDelegationState added in v0.14.4

func NewDelegationState() *DelegationState

type DelegationStore

type DelegationStore struct {
	// contains filtered or unexported fields
}

func NewDelegationStore

func NewDelegationStore(prefix string, state *storage.State) *DelegationStore

func (*DelegationStore) AddToAddress added in v0.16.1

func (st *DelegationStore) AddToAddress(validatorAddress keys.Address, delegatorAddress keys.Address, amount balance.Amount) error

func (*DelegationStore) DumpState added in v0.14.4

func (st *DelegationStore) DumpState(options *Options) (state *DelegationState, succeed bool)

func (*DelegationStore) Get

func (st *DelegationStore) Get(key []byte) (amt *balance.Amount, err error)

func (*DelegationStore) GetDelegatorBoundedAmount

func (st *DelegationStore) GetDelegatorBoundedAmount(delegatorAddress keys.Address) (amount *balance.Amount, err error)

func (*DelegationStore) GetDelegatorEffectiveAmount

func (st *DelegationStore) GetDelegatorEffectiveAmount(delegatorAddress keys.Address) (amount *balance.Amount, err error)

func (*DelegationStore) GetMatureAmounts

func (st *DelegationStore) GetMatureAmounts(version int64) (mature *MatureBlock, err error)

func (*DelegationStore) GetMaturedPendingAmount

func (st *DelegationStore) GetMaturedPendingAmount(delegatorAddress keys.Address, version int64, count int64) []*MatureData

func (*DelegationStore) GetValidatorAmount

func (st *DelegationStore) GetValidatorAmount(validatorAddress keys.Address) (amount *balance.Amount, err error)

func (*DelegationStore) GetValidatorDelegationAmount

func (st *DelegationStore) GetValidatorDelegationAmount(validatorAddress keys.Address, delegatorAddress keys.Address) (amount *balance.Amount, err error)

func (*DelegationStore) LoadState added in v0.14.4

func (st *DelegationStore) LoadState(state DelegationState) (succeed bool)

func (*DelegationStore) MinusFromAddress added in v0.16.1

func (st *DelegationStore) MinusFromAddress(validatorAddress keys.Address, delegatorAddress keys.Address, coin balance.Amount) error

func (*DelegationStore) Set

func (st *DelegationStore) Set(key []byte, amt *balance.Amount) error

func (*DelegationStore) SetDelegatorBoundedAmount

func (st *DelegationStore) SetDelegatorBoundedAmount(delegatorAddress keys.Address, amt balance.Amount) (err error)

func (*DelegationStore) SetDelegatorEffectiveAmount

func (st *DelegationStore) SetDelegatorEffectiveAmount(delegatorAddress keys.Address, amt balance.Amount) (err error)

func (*DelegationStore) SetMatureAmounts

func (st *DelegationStore) SetMatureAmounts(version int64, mature *MatureBlock) (err error)

func (*DelegationStore) SetValidatorAmount

func (st *DelegationStore) SetValidatorAmount(validatorAddress keys.Address, amt balance.Amount) (err error)

func (*DelegationStore) SetValidatorDelegationAmount

func (st *DelegationStore) SetValidatorDelegationAmount(validatorAddress keys.Address, delegatorAddress keys.Address, amt balance.Amount) (err error)

func (*DelegationStore) Stake

func (st *DelegationStore) Stake(validatorAddress keys.Address, delegatorAddress keys.Address, amount balance.Amount) error

func (*DelegationStore) Unstake

func (st *DelegationStore) Unstake(validatorAddress keys.Address, delegatorAddress keys.Address, coin balance.Amount, height int64) error

func (*DelegationStore) UpdateWithdrawReward

func (st *DelegationStore) UpdateWithdrawReward(height int64)

func (*DelegationStore) WithState

func (st *DelegationStore) WithState(state *storage.State) *DelegationStore

func (*DelegationStore) Withdraw

func (st *DelegationStore) Withdraw(validatorAddress keys.Address, delegatorAddress keys.Address, coin balance.Amount) error

type MatureBlock

type MatureBlock struct {
	Height int64
	Data   []*MatureData
}

type MatureData

type MatureData struct {
	Address keys.Address
	Amount  balance.Amount
	Height  int64
}

type Options

type Options struct {
	MinSelfDelegationAmount balance.Amount `json:"minSelfDelegationAmount"`
	MinDelegationAmount     balance.Amount `json:"minDelegationAmount"`
	TopValidatorCount       int64          `json:"topValidatorCount"`
	MaturityTime            int64          `json:"maturityTime"`
}

type ValidatorDelegationAmount added in v0.14.4

type ValidatorDelegationAmount struct {
	Validator keys.Address    `json:"validator"`
	Delegator keys.Address    `json:"delegator"`
	Amount    *balance.Amount `json:"amount"`
}

Jump to

Keyboard shortcuts

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