contract

package
v0.0.0-...-7205676 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeginBlock

type BeginBlock struct {
	Evidence []Evidence `json:"evidence"` // This is key for slashing - let's figure out a standard for these types
}

BeginBlock is delivered every block if the contract is currently registered for Begin Block

type BlockParams

type BlockParams struct {
	// MaxBytes Maximum number of bytes (over all tx) to be included in a block
	MaxBytes *int64 `json:"max_bytes,omitempty"`
	// MaxGas Maximum gas (over all tx) to be executed in one block.
	MaxGas *int64 `json:"max_gas,omitempty"`
}

func (*BlockParams) ValidateBasic

func (p *BlockParams) ValidateBasic() error

ValidateBasic check basics

type ConsensusParamsUpdate

type ConsensusParamsUpdate struct {
	Block    *BlockParams    `json:"block,omitempty"`
	Evidence *EvidenceParams `json:"evidence,omitempty"`
}

ConsensusParamsUpdate subset of tendermint params. See https://github.com/tendermint/tendermint/blob/v0.34.8/proto/tendermint/abci/types.proto#L282-L289

func (ConsensusParamsUpdate) ValidateBasic

func (c ConsensusParamsUpdate) ValidateBasic() error

ValidateBasic check basics

type Delegate

type Delegate struct {
	Funds      wasmvmtypes.Coin `json:"funds"`
	StakerAddr string           `json:"staker"`
}

Delegate funds. Used for vesting accounts.

type Evidence

type Evidence struct {
	EvidenceType EvidenceType `json:"evidence_type"`
	Validator    Validator    `json:"validator"`
	Height       uint64       `json:"height"`
	// the time when the offense occurred (in nanosec UNIX time, like env.block.time)
	Time             uint64 `json:"time"`
	TotalVotingPower uint64 `json:"total_voting_power"`
}

Evidence See https://github.com/tendermint/tendermint/blob/v0.34.8/proto/tendermint/abci/types.proto#L354-L375

type EvidenceParams

type EvidenceParams struct {
	// MaxAgeNumBlocks Max age of evidence, in blocks.
	MaxAgeNumBlocks *int64 `json:"max_age_num_blocks,omitempty"`
	// MaxAgeDuration Max age of evidence, in seconds.
	// It should correspond with an app's "unbonding period"
	MaxAgeDuration *int64 `json:"max_age_duration,omitempty"`
	// MaxBytes Maximum number of bytes of evidence to be included in a block
	MaxBytes *int64 `json:"max_bytes,omitempty"`
}

func (*EvidenceParams) ValidateBasic

func (p *EvidenceParams) ValidateBasic() error

ValidateBasic check basics

type EvidenceType

type EvidenceType string
const (
	EvidenceDuplicateVote     EvidenceType = "duplicate_vote"
	EvidenceLightClientAttack EvidenceType = "light_client_attack"
)

type ExecuteGovProposal

type ExecuteGovProposal struct {
	Title       string      `json:"title"`
	Description string      `json:"description"`
	Proposal    GovProposal `json:"proposal"`
}

ExecuteGovProposal will execute an approved proposal in the Cosmos SDK "Gov Router". That allows access to many of the system internals, like sdk params or x/upgrade, as well as privileged access to the wasm module (eg. mark module privileged)

func ExecuteGovProposalFixture

func ExecuteGovProposalFixture(mutators ...func(proposal *ExecuteGovProposal)) ExecuteGovProposal

ExecuteGovProposalFixture text proposal type

func (ExecuteGovProposal) GetProposalContent

func (p ExecuteGovProposal) GetProposalContent(sender sdk.AccAddress) govtypes.Content

GetProposalContent converts message payload to gov content type. returns `nil` when unknown. The response is not guaranteed to be valid content.

type GovProposal

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

GovProposal bridge to unmarshal json to proposal content types

func GovProposalFixture

func GovProposalFixture(mutators ...func(proposal *GovProposal)) GovProposal

GovProposalFixture empty gov proposal type

func (*GovProposal) UnmarshalJSON

func (p *GovProposal) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom unmarshaler that supports the cosmos-sdk Any types.

type GridironMsg

type GridironMsg struct {
	Privilege          *PrivilegeMsg          `json:"privilege,omitempty"`
	ExecuteGovProposal *ExecuteGovProposal    `json:"execute_gov_proposal,omitempty"`
	MintTokens         *MintTokens            `json:"mint_tokens,omitempty"`
	ConsensusParams    *ConsensusParamsUpdate `json:"consensus_params,omitempty"`
	Delegate           *Delegate              `json:"delegate,omitempty"`
	Undelegate         *Undelegate            `json:"undelegate,omitempty"`
}

GridironMsg messages coming from a contract

func (*GridironMsg) UnmarshalWithAny

func (p *GridironMsg) UnmarshalWithAny(bz []byte, unpacker codectypes.AnyUnpacker) error

UnmarshalWithAny from json to Go objects with cosmos-sdk Any types that have their objects/ interfaces unpacked and set in the `cachedValue` attribute.

type GridironSudoMsg

type GridironSudoMsg struct {
	PrivilegeChange *PrivilegeChangeMsg `json:"privilege_change,omitempty"`

	BeginBlock *BeginBlock `json:"begin_block,omitempty"`
	// This will be delivered every block if the contract is currently registered for End Block
	// Block height and time is already in Env
	EndBlock *struct{} `json:"end_block,omitempty"`
	// This will be delivered after everything.
	// The data in the Response is (JSON?) encoded diff to the validator set
	EndWithValidatorUpdate *struct{} `json:"end_with_validator_update,omitempty"`

	// Export dump state for genesis export
	Export *struct{} `json:"export,omitempty"`
	// Import genesis state
	Import *wasmtypes.RawContractMessage `json:"import,omitempty"`
}

GridironSudoMsg callback message sent to a contract. See https://github.com/mage-coven/gridiron-contracts/blob/main/packages/bindings/src/sudo.rs

type MintTokens

type MintTokens struct {
	Denom         string `json:"denom"`
	Amount        string `json:"amount"`
	RecipientAddr string `json:"recipient"`
}

MintTokens custom message to mint native tokens on the chain. See https://github.com/mage-coven/gridiron-contracts/blob/main/packages/bindings/schema/gridiron_msg.json

type PrivilegeChangeMsg

type PrivilegeChangeMsg struct {
	/// This is called when a contract gets "privileged status".
	/// It is a proper place to call `RegisterXXX` methods that require this status.
	/// Contracts that require this should be in a "frozen" state until they get this callback.
	Promoted *struct{} `json:"promoted,omitempty"`
	/// This is called when a contract looses "privileged status"
	Demoted *struct{} `json:"demoted,omitempty"`
}

PrivilegeChangeMsg is called on a contract when it is made privileged or demoted

type PrivilegeMsg

type PrivilegeMsg struct {
	Request types.PrivilegeType `json:"request,omitempty"`
	Release types.PrivilegeType `json:"release,omitempty"`
}

type ProtoAny

type ProtoAny struct {
	TypeURL string `json:"type_url"`
	Value   []byte `json:"value"`
}

ProtoAny data type to map from json to cosmos-sdk Any type.

func (ProtoAny) Encode

func (a ProtoAny) Encode() *codectypes.Any

Encode converts to a cosmos-sdk Any type.

type Undelegate

type Undelegate struct {
	Funds         wasmvmtypes.Coin `json:"funds"`
	RecipientAddr string           `json:"recipient"`
}

Undelegate funds. Used with vesting accounts.

type Validator

type Validator struct {
	// The first 20 bytes of SHA256(public key)
	Address []byte `json:"address"`
	Power   uint64 `json:"power"`
}

Validator See https://github.com/tendermint/tendermint/blob/v0.34.8/proto/tendermint/abci/types.proto#L336-L340

Jump to

Keyboard shortcuts

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