types

package
v0.0.0-...-52431d2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delegation

type Delegation struct {
	DelegatorAddress string
	ValidatorAddress string
	Amount           sdk.Coin
	Shares           string
	Height           int64
}

Delegation represents a single delegation made from a delegator to a specific validator at a specific height (and timestamp) containing a given amount of tokens

func NewDelegation

func NewDelegation(
	delegator string, validatorAddress string, amount sdk.Coin, shares string, height int64,
) Delegation

NewDelegation creates a new Delegation instance containing the given data

type DelegationShare

type DelegationShare struct {
	ValidatorAddress string
	DelegatorAddress string
	Shares           float64
	Height           int64
	Timestamp        time.Time
}

DelegationShare save the self delegation ratio on that instance

func NewDelegationShare

func NewDelegationShare(
	validatorAddress string, delegatorAddress string, shares float64,
	height int64, timestamp time.Time,
) DelegationShare

NewDelegationShare get a new instance of modify self Delegation

type DoubleSignEvidence

type DoubleSignEvidence struct {
	VoteA  DoubleSignVote
	VoteB  DoubleSignVote
	Height int64
}

DoubleSignEvidence represent a double sign evidence on each tendermint block

func NewDoubleSignEvidence

func NewDoubleSignEvidence(height int64, voteA DoubleSignVote, voteB DoubleSignVote) DoubleSignEvidence

NewDoubleSignEvidence return a new DoubleSignEvidence object

func (DoubleSignEvidence) Equals

Equals tells whether v and w contain the same data

type DoubleSignVote

type DoubleSignVote struct {
	BlockID          string
	ValidatorAddress string
	Signature        string
	Type             int
	Height           int64
	Round            int32
	ValidatorIndex   int32
}

DoubleSignVote represents a double vote which is included inside a DoubleSignEvidence

func NewDoubleSignVote

func NewDoubleSignVote(
	roundType int,
	height int64,
	round int32,
	blockID string,
	validatorAddress string,
	validatorIndex int32,
	signature string,
) DoubleSignVote

NewDoubleSignVote allows to create a new DoubleSignVote instance

func (DoubleSignVote) Equals

func (w DoubleSignVote) Equals(v DoubleSignVote) bool

type Redelegation

type Redelegation struct {
	DelegatorAddress string
	SrcValidator     string
	DstValidator     string
	Amount           sdk.Coin
	CompletionTime   time.Time
	Height           int64
}

Redelegation represents a single re-delegations

func NewRedelegation

func NewRedelegation(
	delegator string, srcValidator, dstValidator string, amount sdk.Coin, completionTime time.Time, height int64,
) Redelegation

NewRedelegation build a new Redelegation object

type StakingParams

type StakingParams struct {
	BondName string
}

StakingParams contains all the parameters related to the staking module

func NewStakingParams

func NewStakingParams(bondDenom string) StakingParams

NewStakingParams allows to build a new StakingParams

type UnbondingDelegation

type UnbondingDelegation struct {
	DelegatorAddress    string
	ValidatorAddress    string
	Amount              sdk.Coin
	CompletionTimestamp time.Time
	Height              int64
}

UnbondingDelegation represents a single unbonding delegation

func NewUnbondingDelegation

func NewUnbondingDelegation(
	delegator string, validator string, amount sdk.Coin, completionTimestamp time.Time,
	height int64,
) UnbondingDelegation

NewUnbondingDelegation allows to create a new UnbondingDelegation instance

type Validator

type Validator interface {
	GetConsAddr() string
	GetConsPubKey() string
	GetOperator() string
	GetSelfDelegateAddress() string
	GetMaxChangeRate() *sdk.Dec
	GetMaxRate() *sdk.Dec
}

Validator represents a single validator. This is defined as an interface so that we can use the SDK types as well as database types properly.

func NewValidator

func NewValidator(
	consAddr string, opAddr string, consPubKey string,
	selfDelegateAddress string, maxChangeRate *sdk.Dec,
	maxRate *sdk.Dec,
) Validator

NewValidator allows to build a new Validator implementation having the given data

type ValidatorCommission

type ValidatorCommission struct {
	ValAddress        string
	Commission        *sdk.Dec
	MinSelfDelegation *sdk.Int
	Height            int64
}

ValidatorCommission allow to build a validator commission instance

func NewValidatorCommission

func NewValidatorCommission(
	valAddress string, rate *sdk.Dec, minSelfDelegation *sdk.Int, height int64,
) ValidatorCommission

NewValidatorCommission return a new validator commission instance

func (ValidatorCommission) Equals

Equals return the equality of two validatorCommission

type ValidatorDelegations

type ValidatorDelegations struct {
	ConsAddress          string
	Delegations          stakingtypes.Delegations
	UnbondingDelegations stakingtypes.UnbondingDelegations
	Height               int64
}

ValidatorDelegations contains both a validator delegations as well as its unbonding delegations

type ValidatorDescription

type ValidatorDescription struct {
	OperatorAddress string
	Description     stakingtypes.Description
	Height          int64
}

ValidatorDescription contains the description of a validator and timestamp do the description get changed

func NewValidatorDescription

func NewValidatorDescription(opAddr string, description stakingtypes.Description, height int64,
) ValidatorDescription

NewValidatorDescription return a new ValidatorDescription object

func (ValidatorDescription) Equals

Equal tells whether v and w contain the same data

type ValidatorStatus

type ValidatorStatus struct {
	ConsensusAddress string
	ConsensusPubKey  string
	Status           int
	Jailed           bool
	Height           int64
}

-------------------------------------------------------- ValidatorStatus represent status and jailed state for validator in specific height an timestamp

func NewValidatorStatus

func NewValidatorStatus(address, pubKey string, status int, jailed bool, height int64) ValidatorStatus

NewValidatorVotingPower creates a new ValidatorVotingPower

func (ValidatorStatus) Equals

func (v ValidatorStatus) Equals(w ValidatorStatus) bool

Equals tells whether v and w are equals

type ValidatorVotingPower

type ValidatorVotingPower struct {
	ConsensusAddress string
	VotingPower      int64
	Height           int64
}

ValidatorVotingPower represents the voting power of a validator at a specific block height

func NewValidatorVotingPower

func NewValidatorVotingPower(address string, votingPower int64, height int64) ValidatorVotingPower

NewValidatorVotingPower creates a new ValidatorVotingPower

func (ValidatorVotingPower) Equals

Equals tells whether v and w are equals

Jump to

Keyboard shortcuts

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