types

package
v4.0.1-0...-868bbd5 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProposalStatusInvalid = "PROPOSAL_STATUS_INVALID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address string
}

Account represents a chain account

func NewAccount

func NewAccount(address string) Account

NewAccount builds a new Account instance

type AccountBalance

type AccountBalance struct {
	Address string
	Balance sdk.Coins
	Height  int64
}

AccountBalance represents the balance of an account at a given height

func NewAccountBalance

func NewAccountBalance(address string, balance sdk.Coins, height int64) AccountBalance

NewAccountBalance allows to build a new AccountBalance instance

type ConsensusEvent

type ConsensusEvent struct {
	Height int64  `json:"height"`
	Round  int32  `json:"round"`
	Step   string `json:"step"`
}

ConsensusEvent represents a consensus event

func NewConsensusEvent

func NewConsensusEvent(height int64, round int32, step string) *ConsensusEvent

NewConsensusEvent allows to easily build a new ConsensusEvent object

func (ConsensusEvent) Equal

func (c ConsensusEvent) Equal(other ConsensusEvent) bool

Equal tells whether c and other contain the same data

type Deposit

type Deposit struct {
	ProposalID      uint64
	Depositor       string
	Amount          sdk.Coins
	Timestamp       time.Time
	TransactionHash string
	Height          int64
}

Deposit contains the data of a single deposit made towards a proposal

func NewDeposit

func NewDeposit(
	proposalID uint64,
	depositor string,
	amount sdk.Coins,
	timestamp time.Time,
	transactionHash string,
	height int64,
) Deposit

NewDeposit return a new Deposit instance

type DistributionParams

type DistributionParams struct {
	distrtypes.Params
	Height int64
}

DistributionParams represents the parameters of the x/distribution module

func NewDistributionParams

func NewDistributionParams(params distrtypes.Params, height int64) *DistributionParams

NewDistributionParams allows to build a new DistributionParams instance

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

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

type FeeGrant

type FeeGrant struct {
	feegranttypes.Grant
	Height int64
}

FeeGrant represents the x/feegrant module

func NewFeeGrant

func NewFeeGrant(feegrant feegranttypes.Grant, height int64) FeeGrant

NewFeeGrant allows to build a new FeeGrant instance

type Genesis

type Genesis struct {
	ChainID       string
	Time          time.Time
	InitialHeight int64
}

Genesis contains the useful information about the genesis

func NewGenesis

func NewGenesis(chainID string, startTime time.Time, initialHeight int64) *Genesis

NewGenesis allows to build a new Genesis instance

func (*Genesis) Equal

func (g *Genesis) Equal(other *Genesis) bool

Equal returns true iff g and other contain the same data

type GovParams

type GovParams struct {
	*govtypesv1.Params
	Height int64 `json:"height" ymal:"height"`
}

GovParams contains the data of the x/gov module parameters

func NewGovParams

func NewGovParams(params *govtypesv1.Params, height int64) *GovParams

type GrantRemoval

type GrantRemoval struct {
	Grantee string
	Granter string
	Height  int64
}

func NewGrantRemoval

func NewGrantRemoval(grantee string, granter string, height int64) GrantRemoval

NewGrantRemoval allows to build a new GrantRemoval instance

type MessageType

type MessageType struct {
	Type   string
	Module string
	Label  string
	Height int64
}

MessageType represents the data of a single message type

func NewMessageType

func NewMessageType(msgType string, module string, label string, height int64) *MessageType

NewMessageType allows to build a new MessageType instance

type MintParams

type MintParams struct {
	minttypes.Params
	Height int64
}

MintParams represents the x/mint parameters

func NewMintParams

func NewMintParams(params minttypes.Params, height int64) *MintParams

NewMintParams allows to build a new MintParams instance

type Pool

type Pool struct {
	BondedTokens          sdkmath.Int
	NotBondedTokens       sdkmath.Int
	UnbondingTokens       sdkmath.Int
	StakedNotBondedTokens sdkmath.Int
	Height                int64
}

Pool contains the data of the staking pool at the given height

func NewPool

func NewPool(bondedTokens, notBondedTokens, unbondingTokens, stakedNotBondedTokens sdkmath.Int, height int64) *Pool

NewPool allows to build a new Pool instance

type PoolSnapshot

type PoolSnapshot struct {
	BondedTokens    sdkmath.Int
	NotBondedTokens sdkmath.Int
	Height          int64
}

PoolSnapshot contains the data of the staking pool snapshot at the given height

func NewPoolSnapshot

func NewPoolSnapshot(bondedTokens, notBondedTokens sdkmath.Int, height int64) *PoolSnapshot

NewPoolSnapshot allows to build a new PoolSnapshot instance

type Proposal

type Proposal struct {
	ID              uint64
	Title           string
	Summary         string
	Metadata        string
	Messages        []*codectypes.Any
	Status          string
	SubmitTime      time.Time
	DepositEndTime  time.Time
	VotingStartTime *time.Time
	VotingEndTime   *time.Time
	Proposer        string
}

Proposal represents a single governance proposal

func NewProposal

func NewProposal(
	proposalID uint64,
	title string,
	summary string,
	metadata string,
	messages []*codectypes.Any,
	status string,
	submitTime time.Time,
	depositEndTime time.Time,
	votingStartTime *time.Time,
	votingEndTime *time.Time,
	proposer string,
) Proposal

NewProposal return a new Proposal instance

type ProposalStakingPoolSnapshot

type ProposalStakingPoolSnapshot struct {
	ProposalID uint64
	Pool       *PoolSnapshot
}

ProposalStakingPoolSnapshot contains the data about a single staking pool snapshot to be associated with a proposal

func NewProposalStakingPoolSnapshot

func NewProposalStakingPoolSnapshot(proposalID uint64, pool *PoolSnapshot) ProposalStakingPoolSnapshot

NewProposalStakingPoolSnapshot returns a new ProposalStakingPoolSnapshot instance

type ProposalUpdate

type ProposalUpdate struct {
	ProposalID      uint64
	Status          string
	VotingStartTime *time.Time
	VotingEndTime   *time.Time
}

ProposalUpdate contains the data that should be used when updating a governance proposal

func NewProposalUpdate

func NewProposalUpdate(proposalID uint64, status string, votingStartTime, votingEndTime *time.Time) ProposalUpdate

NewProposalUpdate allows to build a new ProposalUpdate instance

type ProposalValidatorStatusSnapshot

type ProposalValidatorStatusSnapshot struct {
	ProposalID           uint64
	ValidatorConsAddress string
	ValidatorVotingPower int64
	ValidatorStatus      stakingtypes.BondStatus
	ValidatorJailed      bool
	Height               int64
}

ProposalValidatorStatusSnapshot represents a single snapshot of the status of a validator associated with a single proposal

func NewProposalValidatorStatusSnapshot

func NewProposalValidatorStatusSnapshot(
	proposalID uint64,
	validatorConsAddr string,
	validatorVotingPower int64,
	validatorStatus stakingtypes.BondStatus,
	validatorJailed bool,
	height int64,
) ProposalValidatorStatusSnapshot

NewProposalValidatorStatusSnapshot returns a new ProposalValidatorStatusSnapshot instance

type SlashingParams

type SlashingParams struct {
	slashingtypes.Params
	Height int64
}

SlashingParams represents the parameters of the slashing module at a given height

func NewSlashingParams

func NewSlashingParams(params slashingtypes.Params, height int64) *SlashingParams

NewSlashingParams allows to build a new SlashingParams instance

type StakingParams

type StakingParams struct {
	stakingtypes.Params
	Height int64
}

StakingParams represents the parameters of the x/staking module

func NewStakingParams

func NewStakingParams(params stakingtypes.Params, height int64) StakingParams

NewStakingParams returns a new StakingParams instance

type TallyResult

type TallyResult struct {
	ProposalID uint64
	Yes        string
	Abstain    string
	No         string
	NoWithVeto string
	Height     int64
}

TallyResult contains the data about the final results of a proposal

func NewTallyResult

func NewTallyResult(
	proposalID uint64,
	yes string,
	abstain string,
	no string,
	noWithVeto string,
	height int64,
) TallyResult

NewTallyResult return a new TallyResult instance

type Token

type Token struct {
	Name  string      `yaml:"name"`
	Units []TokenUnit `yaml:"units"`
}

Token represents a valid token inside the chain

func NewToken

func NewToken(name string, units []TokenUnit) Token

type TokenPrice

type TokenPrice struct {
	UnitName  string
	Price     float64
	MarketCap int64
	Timestamp time.Time
}

TokenPrice represents the price at a given moment in time of a token unit

func NewTokenPrice

func NewTokenPrice(unitName string, price float64, marketCap int64, timestamp time.Time) TokenPrice

NewTokenPrice returns a new TokenPrice instance containing the given data

type TokenUnit

type TokenUnit struct {
	Denom    string   `yaml:"denom"`
	Exponent int      `yaml:"exponent"`
	Aliases  []string `yaml:"aliases,omitempty"`
	PriceID  string   `yaml:"price_id,omitempty"`
}

TokenUnit represents a unit of a token

func NewTokenUnit

func NewTokenUnit(denom string, exponent int, aliases []string, priceID string) TokenUnit

type Validator

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

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, height int64,
) 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 contains the data of a validator commission at a given height

func NewValidatorCommission

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

NewValidatorCommission return a new validator commission instance

type ValidatorDescription

type ValidatorDescription struct {
	OperatorAddress string
	Description     stakingtypes.Description
	AvatarURL       string // URL of the avatar to be used. Will be [do-no-modify] if it shouldn't be edited
	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, avatarURL string, height int64,
) ValidatorDescription

NewValidatorDescription return a new ValidatorDescription object

type ValidatorSigningInfo

type ValidatorSigningInfo struct {
	ValidatorAddress    string
	StartHeight         int64
	IndexOffset         int64
	JailedUntil         time.Time
	Tombstoned          bool
	MissedBlocksCounter int64
	Height              int64
}

ValidatorSigningInfo contains the signing info of a validator at a given height

func NewValidatorSigningInfo

func NewValidatorSigningInfo(
	validatorAddress string,
	startHeight int64,
	indexOffset int64,
	jailedUntil time.Time,
	tombstoned bool,
	missedBlocksCounter int64,
	height int64,
) ValidatorSigningInfo

ValidatorSigningInfo allows to build a new ValidatorSigningInfo

func (ValidatorSigningInfo) Equal

Equal tells whether v and w represent the same rows

type ValidatorStatus

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

ValidatorStatus represents the current state for the specified validator at the specific height

func NewValidatorStatus

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

NewValidatorStatus creates a new ValidatorVotingPower

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

type Vote

type Vote struct {
	ProposalID uint64
	Voter      string
	Option     govtypesv1.VoteOption
	Weight     string
	Timestamp  time.Time
	Height     int64
}

Vote contains the data of a single proposal vote

func NewVote

func NewVote(
	proposalID uint64,
	voter string,
	option govtypesv1.VoteOption,
	weight string,
	timestamp time.Time,
	height int64,
) Vote

NewVote return a new Vote instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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