exported

package
v0.0.0-...-8551cdf Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// default bond denomination
	DefaultBondDenom = "kratos/kts"

	// Delay, in blocks, between when validator updates are returned to the
	// consensus-engine and when they are applied. For example, if
	// ValidatorUpdateDelay is set to X, and if a validator set update is
	// returned with new validators at the end of block 10, then the new
	// validators are expected to sign blocks beginning at block 11+X.
	//
	// This value is constant as this should not change without a hard fork.
	// For Tendermint this should be set to 1 block, for more details see:
	// https://tendermint.com/docs/spec/abci/apps.html#endblock
	ValidatorUpdateDelay int64 = 1
)

staking constants

View Source
const (
	Unbonded  BondStatus = 1
	Unbonding BondStatus = 2
	Bonded    BondStatus = 3

	BondStatusUnbonded  = "Unbonded"
	BondStatusUnbonding = "Unbonding"
	BondStatusBonded    = "Bonded"
)

staking constants

Variables

View Source
var PowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil))

PowerReduction is the amount of staking tokens required for 1 unit of consensus-engine power

Functions

func TokensFromConsensusPower

func TokensFromConsensusPower(power int64) sdk.Int

TokensFromConsensusPower - convert input power to tokens

func TokensToConsensusPower

func TokensToConsensusPower(tokens sdk.Int) int64

TokensToConsensusPower - convert input tokens to potential consensus-engine power

Types

type BondStatus

type BondStatus int32

BondStatus is the status of a validator

func (BondStatus) Equal

func (b BondStatus) Equal(b2 BondStatus) bool

Equal compares two BondStatus instances

func (BondStatus) String

func (b BondStatus) String() string

String implements the Stringer interface for BondStatus.

type DelegationI

type DelegationI interface {
	// FIXME: delete Addr
	GetDelegatorAccountID() types.AccountID // delegator sdk.AccAddress for the bond
	GetValidatorAccountID() types.AccountID // validator operator address
	GetShares() sdk.Dec                     // amount of validator's shares held in this delegation
}

DelegationI delegation bond for a delegated proof of stake system

type ValidatorI

type ValidatorI interface {
	IsJailed() bool                                         // whether the validator is jailed
	GetMoniker() string                                     // moniker of the validator
	GetStatus() BondStatus                                  // status of the validator
	IsBonded() bool                                         // check if has a bonded status
	IsUnbonded() bool                                       // check if has status unbonded
	IsUnbonding() bool                                      // check if has status unbonding
	GetOperator() sdk.ValAddress                            // operator address to receive/return validators coins
	GetOperatorAccountID() types.AccountID                  // operator account to receive/return validators coins
	GetConsPubKey() crypto.PubKey                           // validation consensus pubkey
	GetConsAddr() sdk.ConsAddress                           // validation consensus address
	GetTokens() sdk.Int                                     // validation tokens
	GetBondedTokens() sdk.Int                               // validator bonded tokens
	GetConsensusPower() int64                               // validation power in tendermint
	GetCommission() sdk.Dec                                 // validator commission rate
	GetMinSelfDelegation() sdk.Int                          // validator minimum self delegation
	GetDelegatorShares() sdk.Dec                            // total outstanding delegator shares
	TokensFromShares(sdk.Dec) sdk.Dec                       // token worth of provided delegator shares
	TokensFromSharesTruncated(sdk.Dec) sdk.Dec              // token worth of provided delegator shares, truncated
	TokensFromSharesRoundUp(sdk.Dec) sdk.Dec                // token worth of provided delegator shares, rounded up
	SharesFromTokens(amt sdk.Int) (sdk.Dec, error)          // shares worth of delegator's bond
	SharesFromTokensTruncated(amt sdk.Int) (sdk.Dec, error) // truncated shares worth of delegator's bond
}

ValidatorI expected validator functions

Jump to

Keyboard shortcuts

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