v04

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

DONTCOVER nolint

Index

Constants

View Source
const (
	ModuleName = "wasm"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code struct {
	CodeInfo   CodeInfo `json:"code_info"`
	CodesBytes []byte   `json:"code_bytes"`
}

Code struct encompasses CodeInfo and CodeBytes

type CodeInfo

type CodeInfo struct {
	CodeID   uint64         `json:"code_id"`
	CodeHash []byte         `json:"code_hash"`
	Creator  sdk.AccAddress `json:"creator"`
}

CodeInfo is data for the uploaded contract WASM code

type Contract

type Contract struct {
	ContractInfo  ContractInfo `json:"contract_info"`
	ContractStore []Model      `json:"contract_store"`
}

Contract struct encompasses ContractAddress, ContractInfo, and ContractState

type ContractInfo

type ContractInfo struct {
	Address    sdk.AccAddress `json:"address"`
	Owner      sdk.AccAddress `json:"owner"`
	CodeID     uint64         `json:"code_id"`
	InitMsg    []byte         `json:"init_msg"`
	Migratable bool           `json:"migratable"`
}

ContractInfo stores a WASM contract instance

type GenesisState

type GenesisState struct {
	Params         Params     `json:"params" yaml:"params"`
	LastCodeID     uint64     `json:"last_code_id" yaml:"last_code_id"`
	LastInstanceID uint64     `json:"last_instance_id" yaml:"last_instance_id"`
	Codes          []Code     `json:"codes" yaml:"codes"`
	Contracts      []Contract `json:"contracts" yaml:"contracts"`
}

GenesisState is the struct representation of the export genesis

func NewGenesisState

func NewGenesisState(params Params, lastCodeID, lastInstanceID uint64, codes []Code, contracts []Contract) GenesisState

NewGenesisState creates a new GenesisState object

type Model

type Model struct {
	Key   []byte `json:"key"`
	Value []byte `json:"value"`
}

Model is a struct that holds a KV pair

type Params

type Params struct {
	MaxContractSize    uint64 `json:"max_contract_size" yaml:"max_contract_size"`         // allowed max contract bytes size
	MaxContractGas     uint64 `json:"max_contract_gas" yaml:"max_contract_gas"`           // allowed max gas usages per each contract execution
	MaxContractMsgSize uint64 `json:"max_contract_msg_size" yaml:"max_contract_msg_size"` // allowed max contract exe msg bytes size
}

Params wasm parameters

Jump to

Keyboard shortcuts

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