v0_15

package
v0.0.0-...-6cf2bb1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName name used throughout module
	ModuleName = "validatorvesting"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// QuerierRoute should be set to module name
	QuerierRoute = ModuleName

	// QueryPath shortened name for public API (cli and REST)
	QueryPath = "vesting"
)

Variables

View Source
var (
	// BlocktimeKey key for the time of the previous block
	BlocktimeKey = []byte{0x00}
	// ValidatorVestingAccountPrefix store prefix for validator vesting accounts
	ValidatorVestingAccountPrefix = []byte{0x01}
)

Functions

func NewPeriodicVestingAccountRaw

func NewPeriodicVestingAccountRaw(bva *v039auth.BaseVestingAccount, startTime int64, periods v039auth.Periods) *v039auth.PeriodicVestingAccount

NewPeriodicVestingAccountRaw creates a new PeriodicVestingAccount object from BaseVestingAccount

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

func ValidatorVestingAccountKey

func ValidatorVestingAccountKey(addr sdk.AccAddress) []byte

ValidatorVestingAccountKey returns the account address bytes prefixed by ValidatorVestingAccountPrefix

Types

type CurrentPeriodProgress

type CurrentPeriodProgress struct {
	MissedBlocks int64 `json:"missed_blocks" yaml:"missed_blocks"`
	TotalBlocks  int64 `json:"total_blocks" yaml:"total_blocks"`
}

CurrentPeriodProgress tracks the progress of the current vesting period

type Period

type Period struct {
	Length int64     `json:"length" yaml:"length"` // length of the period, in seconds
	Amount sdk.Coins `json:"amount" yaml:"amount"` // amount of coins vesting during this period
}

Period defines a length of time and amount of coins that will vest

type Periods

type Periods []Period

Periods stores all vesting periods passed as part of a PeriodicVestingAccount

type ValidatorVestingAccount

type ValidatorVestingAccount struct {
	*v039auth.PeriodicVestingAccount
	ValidatorAddress       sdk.ConsAddress       `json:"validator_address" yaml:"validator_address"`
	ReturnAddress          sdk.AccAddress        `json:"return_address" yaml:"return_address"`
	SigningThreshold       int64                 `json:"signing_threshold" yaml:"signing_threshold"`
	CurrentPeriodProgress  CurrentPeriodProgress `json:"current_period_progress" yaml:"current_period_progress"`
	VestingPeriodProgress  []VestingProgress     `json:"vesting_period_progress" yaml:"vesting_period_progress"`
	DebtAfterFailedVesting sdk.Coins             `json:"debt_after_failed_vesting" yaml:"debt_after_failed_vesting"`
}

ValidatorVestingAccount implements the VestingAccount interface. It conditionally vests by unlocking coins during each specified period, provided that the validator address has validated at least **SigningThreshold** blocks during the previous vesting period. The signing threshold takes values 0 to 100 are represents the percentage of blocks that must be signed each period for the vesting to complete successfully. If the validator has not signed at least the threshold percentage of blocks during a period, the coins are returned to the return address, or burned if the return address is null.

func (*ValidatorVestingAccount) UnmarshalJSON

func (vva *ValidatorVestingAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into a ValidatorVestingAccount.

type VestingProgress

type VestingProgress struct {
	PeriodComplete    bool `json:"period_complete" yaml:"period_complete"`
	VestingSuccessful bool `json:"vesting_successful" yaml:"vesting_successful"`
}

VestingProgress tracks the status of each vesting period

Jump to

Keyboard shortcuts

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