types

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = ModuleName

	CodePublicKeyDecode            sdk.CodeType = 101
	CodeProtocolVersionParse       sdk.CodeType = 102
	CodeTomlParse                  sdk.CodeType = 103
	CodeInvalidValidator           sdk.CodeType = 201
	CodeInvalidDelegation          sdk.CodeType = 202
	CodeInvalidInput               sdk.CodeType = 203
	CodeInvalidAddress             sdk.CodeType = sdk.CodeInvalidAddress
	CodeGRpcExecuteMissingParent   sdk.CodeType = 301
	CodeGRpcExecuteDeployGasError  sdk.CodeType = 302
	CodeGRpcExecuteDeployExecError sdk.CodeType = 303
)
View Source
const (
	// ModuleName uses for schema name in key-value store
	ModuleName = "contract"

	// StoreKey sets schema name from ModuleName
	HashMapStoreKey = ModuleName + "_hashmap"

	// key value
	GenesisBlockHashKey  = "genesisblockhash"
	GenesisConfigKey     = "genesisconf"
	GenesisAccountKey    = "genesisaccount"
	CandidateBlockKey    = "candidateblock"
	ProxyContractHashKey = "proxycontractkey"
	ProtoclVersionKey    = "protocolversion"
)
View Source
const (
	ADDRESS = "address"
	UREF    = "uref"
	HASH    = "hash"
	LOCAL   = "local"

	SYSTEM = "system"
)
View Source
const (
	MintContractName = "mint"
	PosContractName  = "pos"

	ProxyContractName         = "client_api_proxy"
	TransferMethodName        = "transfer_to_account"
	PaymentMethodName         = "standard_payment"
	BondMethodName            = "bond"
	UnbondMethodName          = "unbond"
	DelegateMethodName        = "delegate"
	UndelegateMethodName      = "undelegate"
	RedelegateMethodName      = "redelegate"
	VoteMethodName            = "vote"
	UnvoteMethodName          = "unvote"
	StepMethodName            = "step"
	ClaimRewardMethodName     = "claim_reward"
	ClaimCommissionMethodName = "claim_commission"

	SYSTEM_ACCOUNT_BALANCE       = "1000000000000000000000000000000"
	TRANSFER_BALANCE             = "999999999999000000000000000000"
	SYSTEM_ACCOUNT_BONDED_AMOUNT = "0"
	BASIC_FEE                    = "10000000000000000"
	BASIC_GAS                    = 10
	BASIC_PAY_AMOUNT             = "1000000000000000000000"

	DECIMAL_POINT_POS = 18

	RewardString     = "reward"
	CommissionString = "commission"
	RewardValue      = true
	CommissionValue  = false
)
View Source
const (
	// TODO: Why can't we just have one string description which can be JSON by convention
	MaxMonikerLength  = 70
	MaxIdentityLength = 3000
	MaxWebsiteLength  = 140
	MaxDetailsLength  = 280
)

nolint

View Source
const DoNotModifyDesc = "[do-not-modify]"

constant used in flags to indicate that description field should not be updated

View Source
const RouterKey = ModuleName

RouterKey is not in sense yet

Variables

View Source
var (
	EEStateKey              = []byte{0x11}
	ValidatorKey            = []byte{0x21}
	ValidatorsByConsAddrKey = []byte{0x22}
)
View Source
var (
	SYSTEM_ACCOUNT   = make([]byte, 32)
	TEMP_ACC_ADDRESS = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
)
View Source
var ModuleCdc *codec.Codec

ModuleCdc is used as a codec in types package

Functions

func ErrBadDelegationAddr added in v0.3.0

func ErrBadDelegationAddr(codespace sdk.CodespaceType) sdk.Error

func ErrBadDelegationAmount added in v0.3.0

func ErrBadDelegationAmount(codespace sdk.CodespaceType) sdk.Error

func ErrBadValidatorAddr added in v0.3.0

func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error

func ErrDescriptionLength added in v0.3.0

func ErrDescriptionLength(codespace sdk.CodespaceType, descriptor string, got, max int) sdk.Error

func ErrGRpcExecuteDeployExecError added in v0.4.0

func ErrGRpcExecuteDeployExecError(codespace sdk.CodespaceType, msg string) sdk.Error

func ErrGRpcExecuteDeployGasError added in v0.4.0

func ErrGRpcExecuteDeployGasError(codespace sdk.CodespaceType) sdk.Error

func ErrGRpcExecuteMissingParent added in v0.4.0

func ErrGRpcExecuteMissingParent(codespace sdk.CodespaceType, hash string) sdk.Error

func ErrNilDelegatorAddr added in v0.3.0

func ErrNilDelegatorAddr(codespace sdk.CodespaceType) sdk.Error

func ErrNilValidatorAddr added in v0.3.0

func ErrNilValidatorAddr(codespace sdk.CodespaceType) sdk.Error

func ErrProtocolVersionParse

func ErrProtocolVersionParse(codespace sdk.CodespaceType, protocolVersion string) sdk.Error

ErrProtocolVersionParse is an error

func ErrPublicKeyDecode

func ErrPublicKeyDecode(codespace sdk.CodespaceType, publicKey string) sdk.Error

ErrPublicKeyDecode is an error

func ErrTomlParse added in v0.2.0

func ErrTomlParse(codespace sdk.CodespaceType, keyString string) sdk.Error

ErrTomlParse is an error

func ErrValidatorOwnerExists added in v0.11.0

func ErrValidatorOwnerExists(codespace sdk.CodespaceType) sdk.Error

func ErrValidatorPubKeyExists added in v0.11.0

func ErrValidatorPubKeyExists(codespace sdk.CodespaceType) sdk.Error

func ErrValidatorPubKeyTypeNotSupported added in v0.11.0

func ErrValidatorPubKeyTypeNotSupported(codespace sdk.CodespaceType, keyType string, supportedTypes []string) sdk.Error

func GetEEStateKey added in v0.3.0

func GetEEStateKey(height int64) []byte

func GetValidatorByConsAddrKey added in v0.11.0

func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte

func GetValidatorKey added in v0.3.0

func GetValidatorKey(operatorAddr sdk.AccAddress) []byte

func MustMarshalDelegator added in v0.8.0

func MustMarshalDelegator(cdc *codec.Codec, delegator Delegator) []byte

return the delegate

func MustMarshalValidator added in v0.3.0

func MustMarshalValidator(cdc *codec.Codec, validator Validator) []byte

return the redelegation

func MustMarshalVoter added in v0.8.0

func MustMarshalVoter(cdc *codec.Codec, voter Voter) []byte

return the voter

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func ToChainSpecGenesisConfig

func ToChainSpecGenesisConfig(gs GenesisState) (*ipc.ChainSpec_GenesisConfig, error)

func ToProtocolVersion added in v0.3.0

func ToProtocolVersion(pvString string) (*state.ProtocolVersion, error)

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis :

Types

type Account

type Account struct {
	Address             sdk.AccAddress `json:"address"`
	InitialBalance      string         `json:"initial_balance"`
	InitialBondedAmount string         `json:"initial_bonded_amount"`
}

Account : Genesis Account Information.

type ContractAddress added in v0.9.0

type ContractAddress = sdk.ContractAddress

type ContractHashAddress added in v0.9.0

type ContractHashAddress = sdk.ContractHashAddress

type ContractUrefAddress added in v0.9.0

type ContractUrefAddress = sdk.ContractUrefAddress

type Delegator added in v0.8.0

type Delegator struct {
	Address sdk.AccAddress `json:"address" yaml:"address"`
	Amount  string         `json:"amount" yaml:"amount"`
}

func MustUnmarshalDelegator added in v0.8.0

func MustUnmarshalDelegator(cdc *codec.Codec, value []byte) Delegator

unmarshal a delegator from a store value

func NewDelegator added in v0.8.0

func NewDelegator(address sdk.AccAddress, amount string) Delegator

NewDelegator - initialize a new delegator

func UnmarshalDelegator added in v0.8.0

func UnmarshalDelegator(cdc *codec.Codec, value []byte) (delegator Delegator, err error)

unmarshal a delegator from a store value

func (Delegator) String added in v0.8.0

func (d Delegator) String() string

String returns a human readable string representation of a validator.

type Delegators added in v0.8.0

type Delegators []Delegator

Delegators is a collection of Delegator

func (Delegators) String added in v0.8.0

func (d Delegators) String() (out string)

type DeployConfig added in v0.4.0

type DeployConfig struct {
	MaxTtlMillis      uint32 `json:"max-ttl-millis" toml:"max-ttl-millis"`
	MaxDependencies   uint32 `json:"max-dependencies" toml:"max-dependencies"`
	MaxBlockSizeBytes uint32 `json:"max-block-size-bytes" toml:"max-block-size-bytes"`
	MaxBlockCost      uint64 `json:"max-block-cost" toml:"max-block-cost"`
}

type Description added in v0.3.0

type Description struct {
	Moniker  string `json:"moniker" yaml:"moniker"`   // name
	Identity string `json:"identity" yaml:"identity"` // optional identity signature (ex. UPort or Keybase)
	Website  string `json:"website" yaml:"website"`   // optional website link
	Details  string `json:"details" yaml:"details"`   // optional details
}

Description - description fields for a validator

func NewDescription added in v0.3.0

func NewDescription(moniker, identity, website, details string) Description

NewDescription returns a new Description with the provided values.

func (Description) EnsureLength added in v0.3.0

func (d Description) EnsureLength() (Description, sdk.Error)

EnsureLength ensures the length of a validator's description.

func (Description) UpdateDescription added in v0.3.0

func (d Description) UpdateDescription(d2 Description) (Description, sdk.Error)

UpdateDescription updates the fields of a given description. An error is returned if the resulting description contains an invalid length.

type Genesis

type Genesis struct {
	Timestamp           uint64 `json:"timestamp"`
	MintWasm            []byte `json:"mint_wasm"`
	PosWasm             []byte `json:"pos_wasm"`
	StandardPaymentWasm []byte `json:"standrad_payment_wasm`
	ProtocolVersion     string `json:"protocol_version"`
}

Genesis : Chain Genesis information

type GenesisConf

type GenesisConf struct {
	Genesis       Genesis       `json:"genesis"`
	WasmCosts     WasmCosts     `json:"wasm_costs"`
	DeployConfig  DeployConfig  `json:"deploy_config"`
	HighwayConfig HighwayConfig `json:"highway_config"`
}

GenesisConf : the executionlayer configuration that must be provided at genesis.

type GenesisState

type GenesisState struct {
	GenesisConf GenesisConf `json:"genesis_conf"`
	Accounts    []Account   `json:"accounts"`
	ChainName   string      `json:"chain_name"`
	Validators  []Validator `json:"validators"`
	StateInfos  []string    `json:"state_infos"`
}

GenesisState : the executionlayer state that must be provided at genesis.

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func NewGenesisState

func NewGenesisState(genesisConf GenesisConf, accounts []Account, chainName string, validators Validators, stateInfos []string) GenesisState

NewGenesisState creates a new genesis state.

type HighwayConfig added in v0.9.0

type HighwayConfig struct {
	GenesisEraStartTimestamp   uint64 `json:"genesis-era-start" toml:"genesis-era-start"`
	EraDurationMillis          uint64 `json:"era-duration" toml:"era-duration"`
	BookingDurationMillis      uint64 `json:"booking-duration" toml:"booking-duration"`
	EntropyDurationMillis      uint64 `json:"entropy-duration" toml:"entropy-duration"`
	VotingPeriodDurationMillis uint64 `json:"voting-period-duration" toml:"voting-period-duration"`
	VotingPeriodSummitLevel    uint32 `json:"voting-period-summit-level" toml:"voting-period-summit-level"`
	Ftt                        uint32 `json:"ftt" toml:"ftt"`
}

type MsgBond added in v0.3.0

type MsgBond struct {
	ContractAddress string         `json:"contract_address" yaml:"contract_address"`
	FromAddress     sdk.AccAddress `json:"from_address" yaml:"from_address"`
	Amount          string         `json:"amount" yaml:"amount"`
	Fee             string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgBond added in v0.3.0

func NewMsgBond(
	tokenContractAddress string,
	bonderAddress sdk.AccAddress,
	amount, fee string,
) MsgBond

NewMsgBond is a constructor function for MsgSetName

func (MsgBond) GetSignBytes added in v0.3.0

func (msg MsgBond) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgBond) GetSigners added in v0.3.0

func (msg MsgBond) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgBond) Route added in v0.3.0

func (msg MsgBond) Route() string

Route should return the name of the module

func (MsgBond) Type added in v0.3.0

func (msg MsgBond) Type() string

Type should return the action

func (MsgBond) ValidateBasic added in v0.3.0

func (msg MsgBond) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgClaim added in v0.9.0

type MsgClaim struct {
	ContractAddress    string         `json:"contract_address" yaml:"contract_address"`
	FromAddress        sdk.AccAddress `json:"from_address" yaml:"from_address"`
	RewardOrCommission bool           `json:"reward_or_commission" yaml:"reward_or_commission"`
	Fee                string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgClaim added in v0.9.0

func NewMsgClaim(
	tokenContractAddress string,
	fromAddress sdk.AccAddress,
	rewardOrCommission bool,
	fee string,
) MsgClaim

NewMsgClaim is a constructor function for MsgSetName

func (MsgClaim) GetSignBytes added in v0.9.0

func (msg MsgClaim) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgClaim) GetSigners added in v0.9.0

func (msg MsgClaim) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgClaim) Route added in v0.9.0

func (msg MsgClaim) Route() string

Route should return the name of the module

func (MsgClaim) Type added in v0.9.0

func (msg MsgClaim) Type() string

Type should return the action

func (MsgClaim) ValidateBasic added in v0.9.0

func (msg MsgClaim) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgCreateValidator added in v0.3.0

type MsgCreateValidator struct {
	ContractAddress  string         `json:"contract_address" yaml:"contract_address"`
	ValidatorAddress sdk.AccAddress `json:"validator_address" yaml:"validator_address"`
	ConsPubKey       crypto.PubKey  `json:"cons_pubkey" yaml:"cons_pubkey"`
	Description      Description    `json:"description" yaml:"description"`
	Fee              string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________ MsgCreateValidator - struct for bonding transactions

func NewMsgCreateValidator added in v0.3.0

func NewMsgCreateValidator(
	contractAddress string,
	valAddress sdk.AccAddress,
	consPubKey crypto.PubKey,
	description Description,
	fee string,
) MsgCreateValidator

Default way to create validator. Delegator address and validator address are the same

func (MsgCreateValidator) GetSignBytes added in v0.3.0

func (msg MsgCreateValidator) GetSignBytes() []byte

GetSignBytes returns the message bytes to sign over.

func (MsgCreateValidator) GetSigners added in v0.3.0

func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress

Return address(es) that must sign over msg.GetSignBytes()

func (MsgCreateValidator) MarshalJSON added in v0.3.0

func (msg MsgCreateValidator) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface to provide custom JSON serialization of the MsgCreateValidator type.

func (MsgCreateValidator) Route added in v0.3.0

func (msg MsgCreateValidator) Route() string

nolint

func (MsgCreateValidator) Type added in v0.3.0

func (msg MsgCreateValidator) Type() string

func (*MsgCreateValidator) UnmarshalJSON added in v0.3.0

func (msg *MsgCreateValidator) UnmarshalJSON(bz []byte) error

UnmarshalJSON implements the json.Unmarshaler interface to provide custom JSON deserialization of the MsgCreateValidator type.

func (MsgCreateValidator) ValidateBasic added in v0.3.0

func (msg MsgCreateValidator) ValidateBasic() sdk.Error

quick validity check

type MsgDelegate added in v0.7.0

type MsgDelegate struct {
	ContractAddress string         `json:"contract_address" yaml:"contract_address"`
	FromAddress     sdk.AccAddress `json:"from_address" yaml:"from_address"`
	ValAddress      sdk.AccAddress `json:"val_address" yaml:"val_address"`
	Amount          string         `json:"amount" yaml:"amount"`
	Fee             string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgDelegate added in v0.7.0

func NewMsgDelegate(
	tokenContractAddress string,
	fromAddress, vaildatorAddress sdk.AccAddress,
	amount, fee string,
) MsgDelegate

NewMsgDelegate is a constructor function for MsgSetName

func (MsgDelegate) GetSignBytes added in v0.7.0

func (msg MsgDelegate) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgDelegate) GetSigners added in v0.7.0

func (msg MsgDelegate) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgDelegate) Route added in v0.7.0

func (msg MsgDelegate) Route() string

Route should return the name of the module

func (MsgDelegate) Type added in v0.7.0

func (msg MsgDelegate) Type() string

Type should return the action

func (MsgDelegate) ValidateBasic added in v0.7.0

func (msg MsgDelegate) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgEditValidator added in v0.5.0

type MsgEditValidator struct {
	ContractAddress  string         `json:"contract_address" yaml:"contract_address"`
	ValidatorAddress sdk.AccAddress `json:"address" yaml:"address"`
	Description      Description    `json:"description" yaml:"description"`
	Fee              string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________ MsgEditValidator - struct for editing a validator

func NewMsgEditValidator added in v0.5.0

func NewMsgEditValidator(contractAddress string, valAddr sdk.AccAddress, description Description, fee string) MsgEditValidator

func (MsgEditValidator) GetSignBytes added in v0.5.0

func (msg MsgEditValidator) GetSignBytes() []byte

get the bytes for the message signer to sign on

func (MsgEditValidator) GetSigners added in v0.5.0

func (msg MsgEditValidator) GetSigners() []sdk.AccAddress

func (MsgEditValidator) Route added in v0.5.0

func (msg MsgEditValidator) Route() string

nolint

func (MsgEditValidator) Type added in v0.5.0

func (msg MsgEditValidator) Type() string

func (MsgEditValidator) ValidateBasic added in v0.5.0

func (msg MsgEditValidator) ValidateBasic() sdk.Error

quick validity check

type MsgExecute

type MsgExecute struct {
	ContractAddress string            `json:"contract_address"`
	ExecAddress     sdk.AccAddress    `json:"exec_address"`
	SessionType     util.ContractType `json:"session_type"`
	SessionCode     []byte            `json:"session_code"`
	SessionArgs     string            `json:"session_args"`
	Fee             string            `json:"fee"`
}

MsgExecute for sending deploy to execution engine

func NewMsgExecute

func NewMsgExecute(
	contractAddress string,
	execAddress sdk.AccAddress,
	sessionType util.ContractType,
	sessionCode []byte,
	sessionArgs string,
	fee string,
) MsgExecute

NewMsgExecute is a constructor function for MsgSetName

func (MsgExecute) GetSignBytes

func (msg MsgExecute) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgExecute) GetSigners

func (msg MsgExecute) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgExecute) Route

func (msg MsgExecute) Route() string

Route should return the name of the module

func (MsgExecute) Type

func (msg MsgExecute) Type() string

Type should return the action

func (MsgExecute) ValidateBasic

func (msg MsgExecute) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgRedelegate added in v0.7.0

type MsgRedelegate struct {
	ContractAddress string         `json:"contract_address" yaml:"contract_address"`
	FromAddress     sdk.AccAddress `json:"from_address" yaml:"from_address"`
	SrcValAddress   sdk.AccAddress `json:"src_val_address" yaml:"src_val_address"`
	DestValAddress  sdk.AccAddress `json:"dest_val_address" yaml:"dest_val_address"`
	Amount          string         `json:"amount" yaml:"amount"`
	Fee             string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgRedelegate added in v0.7.0

func NewMsgRedelegate(
	tokenContractAddress string,
	fromAddress, srcVaildatorAddress, descVaildatorAddress sdk.AccAddress,
	amount, fee string,
) MsgRedelegate

MsgRedelegate is a constructor function for MsgSetName

func (MsgRedelegate) GetSignBytes added in v0.7.0

func (msg MsgRedelegate) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgRedelegate) GetSigners added in v0.7.0

func (msg MsgRedelegate) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgRedelegate) Route added in v0.7.0

func (msg MsgRedelegate) Route() string

Route should return the name of the module

func (MsgRedelegate) Type added in v0.7.0

func (msg MsgRedelegate) Type() string

Type should return the action

func (MsgRedelegate) ValidateBasic added in v0.7.0

func (msg MsgRedelegate) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgTransfer added in v0.3.0

type MsgTransfer struct {
	ContractAddress string         `json:"contract_address" yaml:"contract_address"`
	FromAddress     sdk.AccAddress `json:"from_address" yaml:"from_address"`
	ToAddress       sdk.AccAddress `json:"to_address" yaml:"to_address"`
	Amount          string         `json:"amount" yaml:"amount"`
	Fee             string         `json:"fee" yaml:"fee"`
}

MsgTransfer for sending deploy to execution engine

func NewMsgTransfer added in v0.3.0

func NewMsgTransfer(
	tokenContractAddress string,
	fromAddress, toAddress sdk.AccAddress,
	amount, fee string,
) MsgTransfer

NewMsgTransfer is a constructor function for MsgSetName

func (MsgTransfer) GetSignBytes added in v0.3.0

func (msg MsgTransfer) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgTransfer) GetSigners added in v0.3.0

func (msg MsgTransfer) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgTransfer) Route added in v0.3.0

func (msg MsgTransfer) Route() string

Route should return the name of the module

func (MsgTransfer) Type added in v0.3.0

func (msg MsgTransfer) Type() string

Type should return the action

func (MsgTransfer) ValidateBasic added in v0.3.0

func (msg MsgTransfer) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgUnBond added in v0.3.0

type MsgUnBond struct {
	ContractAddress string         `json:"contract_address" yaml:"contract_address"`
	FromAddress     sdk.AccAddress `json:"from_address" yaml:"from_address"`
	Amount          string         `json:"amount" yaml:"amount"`
	Fee             string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgUnBond added in v0.3.0

func NewMsgUnBond(
	tokenContractAddress string,
	unbonderAddress sdk.AccAddress,
	amount, fee string,
) MsgUnBond

NewMsgUnBond is a constructor function for MsgSetName

func (MsgUnBond) GetSignBytes added in v0.3.0

func (msg MsgUnBond) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgUnBond) GetSigners added in v0.3.0

func (msg MsgUnBond) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgUnBond) Route added in v0.3.0

func (msg MsgUnBond) Route() string

Route should return the name of the module

func (MsgUnBond) Type added in v0.3.0

func (msg MsgUnBond) Type() string

Type should return the action

func (MsgUnBond) ValidateBasic added in v0.3.0

func (msg MsgUnBond) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgUndelegate added in v0.7.0

type MsgUndelegate struct {
	ContractAddress string         `json:"contract_address" yaml:"contract_address"`
	FromAddress     sdk.AccAddress `json:"from_address" yaml:"from_address"`
	ValAddress      sdk.AccAddress `json:"val_address" yaml:"val_address"`
	Amount          string         `json:"amount" yaml:"amount"`
	Fee             string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgUndelegate added in v0.7.0

func NewMsgUndelegate(
	tokenContractAddress string,
	fromAddress, vaildatorAddress sdk.AccAddress,
	amount, fee string,
) MsgUndelegate

NewMsgUndelegate is a constructor function for MsgSetName

func (MsgUndelegate) GetSignBytes added in v0.7.0

func (msg MsgUndelegate) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgUndelegate) GetSigners added in v0.7.0

func (msg MsgUndelegate) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgUndelegate) Route added in v0.7.0

func (msg MsgUndelegate) Route() string

Route should return the name of the module

func (MsgUndelegate) Type added in v0.7.0

func (msg MsgUndelegate) Type() string

Type should return the action

func (MsgUndelegate) ValidateBasic added in v0.7.0

func (msg MsgUndelegate) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgUnvote added in v0.8.0

type MsgUnvote struct {
	ContractAddress       string         `json:"contract_address" yaml:"contract_address"`
	FromAddress           sdk.AccAddress `json:"from_address" yaml:"from_address"`
	TargetContractAddress string         `json:"target_contract_address" yaml:"target_contract_address"`
	Amount                string         `json:"amount" yaml:"amount"`
	Fee                   string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgUnvote added in v0.8.0

func NewMsgUnvote(
	tokenContractAddress string,
	fromAddress sdk.AccAddress,
	targetContractAddress sdk.ContractAddress,
	amount, fee string,
) MsgUnvote

NewMsgUnvote is a constructor function for MsgSetName

func (MsgUnvote) GetSignBytes added in v0.8.0

func (msg MsgUnvote) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgUnvote) GetSigners added in v0.8.0

func (msg MsgUnvote) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgUnvote) Route added in v0.8.0

func (msg MsgUnvote) Route() string

Route should return the name of the module

func (MsgUnvote) Type added in v0.8.0

func (msg MsgUnvote) Type() string

Type should return the action

func (MsgUnvote) ValidateBasic added in v0.8.0

func (msg MsgUnvote) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgVote added in v0.8.0

type MsgVote struct {
	ContractAddress       string         `json:"contract_address" yaml:"contract_address"`
	FromAddress           sdk.AccAddress `json:"from_address" yaml:"from_address"`
	TargetContractAddress string         `json:"target_contract_address" yaml:"target_contract_address"`
	Amount                string         `json:"amount" yaml:"amount"`
	Fee                   string         `json:"fee" yaml:"fee"`
}

______________________________________________________________________

func NewMsgVote added in v0.8.0

func NewMsgVote(
	tokenContractAddress string,
	fromAddress sdk.AccAddress,
	targetContractAddress sdk.ContractAddress,
	amount, fee string,
) MsgVote

NewMsgVote is a constructor function for MsgSetName

func (MsgVote) GetSignBytes added in v0.8.0

func (msg MsgVote) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgVote) GetSigners added in v0.8.0

func (msg MsgVote) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgVote) Route added in v0.8.0

func (msg MsgVote) Route() string

Route should return the name of the module

func (MsgVote) Type added in v0.8.0

func (msg MsgVote) Type() string

Type should return the action

func (MsgVote) ValidateBasic added in v0.8.0

func (msg MsgVote) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type QueryDelegatorParams added in v0.8.0

type QueryDelegatorParams struct {
	DelegatorAddr sdk.AccAddress `json:"delegator_address"`
	ValidatorAddr sdk.AccAddress `json:"validator_address"`
}

defines the params for the following queries: - 'custom/%s/delegator'

func NewQueryDelegatorParams added in v0.8.0

func NewQueryDelegatorParams(delegaatorAddr sdk.AccAddress, validatorAddr sdk.AccAddress) QueryDelegatorParams

type QueryExecutionLayerDetail

type QueryExecutionLayerDetail struct {
	KeyType string `json:"key_type"`
	KeyData string `json:"key_data"`
	Path    string `json:"path"`
}

QueryExecutionLayerDetail payload for a EE query

func (QueryExecutionLayerDetail) String

func (q QueryExecutionLayerDetail) String() string

implement fmt.Stringer

type QueryGetBalanceDetail

type QueryGetBalanceDetail struct {
	Address sdk.AccAddress `json:"address"`
}

QueryGetBalanceDetail payload for balance query

func (QueryGetBalanceDetail) String

func (q QueryGetBalanceDetail) String() string

implement fmt.Stringer

type QueryGetCommission added in v0.9.0

type QueryGetCommission struct {
	Address sdk.AccAddress `json:"address"`
}

QueryGetCommission payload for commission query

func NewQueryGetCommission added in v0.9.0

func NewQueryGetCommission(address sdk.AccAddress) QueryGetCommission

func (QueryGetCommission) String added in v0.9.0

func (q QueryGetCommission) String() string

implement fmt.Stringer

type QueryGetReward added in v0.9.0

type QueryGetReward struct {
	Address sdk.AccAddress `json:"address"`
}

QueryGetReward payload for reward query

func NewQueryGetReward added in v0.9.0

func NewQueryGetReward(address sdk.AccAddress) QueryGetReward

func (QueryGetReward) String added in v0.9.0

func (q QueryGetReward) String() string

implement fmt.Stringer

type QueryGetStakeDetail added in v0.11.0

type QueryGetStakeDetail struct {
	Address sdk.AccAddress `json:"address"`
}

QueryGetStakeDetail payload for stake query

func (QueryGetStakeDetail) String added in v0.11.0

func (q QueryGetStakeDetail) String() string

implement fmt.Stringer

type QueryGetVoteDetail added in v0.11.0

type QueryGetVoteDetail struct {
	Address sdk.AccAddress `json:"address"`
	Dapp    string         `json:"dapp"`
}

QueryGetVoteDetail payload for user's vote amount query

func (QueryGetVoteDetail) String added in v0.11.0

func (q QueryGetVoteDetail) String() string

implement fmt.Stringer

type QueryValidatorParams added in v0.5.0

type QueryValidatorParams struct {
	ValidatorAddr sdk.AccAddress `json:"validator_address"`
}

defines the params for the following queries: - 'custom/%s/validator'

func NewQueryValidatorParams added in v0.5.0

func NewQueryValidatorParams(validatorAddr sdk.AccAddress) QueryValidatorParams

type QueryVoterParams added in v0.8.0

type QueryVoterParams interface {
	GetAddress() sdk.AccAddress
	GetContract() ContractAddress
}

defines the params for the following queries: - 'custom/%s/voter'

type QueryVoterParamsHash added in v0.9.0

type QueryVoterParamsHash struct {
	Address  sdk.AccAddress      `json:"address"`
	Contract ContractHashAddress `json:"contract_address"`
}

func NewQueryVoterHashParams added in v0.9.0

func NewQueryVoterHashParams(address sdk.AccAddress, contractAddress ContractHashAddress) QueryVoterParamsHash

func (QueryVoterParamsHash) GetAddress added in v0.9.0

func (q QueryVoterParamsHash) GetAddress() sdk.AccAddress

func (QueryVoterParamsHash) GetContract added in v0.9.0

func (q QueryVoterParamsHash) GetContract() ContractAddress

type QueryVoterParamsUref added in v0.9.0

type QueryVoterParamsUref struct {
	Address  sdk.AccAddress      `json:"address"`
	Contract ContractUrefAddress `json:"contract_address"`
}

func NewQueryVoterUrefParams added in v0.9.0

func NewQueryVoterUrefParams(address sdk.AccAddress, contractAddress ContractUrefAddress) QueryVoterParamsUref

func (QueryVoterParamsUref) GetAddress added in v0.9.0

func (q QueryVoterParamsUref) GetAddress() sdk.AccAddress

func (QueryVoterParamsUref) GetContract added in v0.9.0

func (q QueryVoterParamsUref) GetContract() ContractAddress

type QueryVoterResponse added in v0.11.0

type QueryVoterResponse struct {
	Address string `json:"address"`
	Amount  string `json:"amount"`
}

func NewQueryVoterResponse added in v0.11.0

func NewQueryVoterResponse(address string, amount string) QueryVoterResponse

type UnitHashMap

type UnitHashMap struct {
	EEState []byte `json:"ee_state"`
}

UnitHashMap used to define Unit account structure

func NewUnitHashMap

func NewUnitHashMap(eeState []byte) UnitHashMap

NewUnitHashMap returns a new UnitAccount

func (UnitHashMap) String

func (u UnitHashMap) String() string

implement fmt.Stringer

type Validator added in v0.3.0

type Validator struct {
	OperatorAddress sdk.AccAddress `json:"operator_address" yaml:"operator_address"` // address of the validator's operator; bech encoded in JSON
	ConsPubKey      crypto.PubKey  `json:"consensus_pubkey" yaml:"consensus_pubkey"` // the consensus public key of the validator; bech encoded in JSON
	Description     Description    `json:"description" yaml:"description"`           // description terms for the validator
	Stake           string         `json:"stake" yaml:"stake"`
}

Validator - save a validater information

func MustUnmarshalValidator added in v0.3.0

func MustUnmarshalValidator(cdc *codec.Codec, value []byte) Validator

unmarshal a redelegation from a store value

func NewValidator added in v0.3.0

func NewValidator(operator sdk.AccAddress, pubKey crypto.PubKey, description Description, stake string) Validator

NewValidator - initialize a new validator

func UnmarshalValidator added in v0.3.0

func UnmarshalValidator(cdc *codec.Codec, value []byte) (validator Validator, err error)

unmarshal a redelegation from a store value

func (Validator) ConsAddress added in v0.3.0

func (v Validator) ConsAddress() sdk.ConsAddress

return the TM validator address

func (Validator) MarshalJSON added in v0.3.0

func (v Validator) MarshalJSON() ([]byte, error)

MarshalJSON marshals the validator to JSON using Bech32

func (Validator) String added in v0.3.0

func (v Validator) String() string

String returns a human readable string representation of a validator.

func (Validator) TestEquivalent added in v0.3.0

func (v Validator) TestEquivalent(v2 Validator) bool

only the vitals

func (*Validator) UnmarshalJSON added in v0.3.0

func (v *Validator) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the validator from JSON using Bech32

type Validators added in v0.5.0

type Validators []Validator

Validators is a collection of Validator

func (Validators) String added in v0.5.0

func (v Validators) String() (out string)

type Voter added in v0.8.0

type Voter struct {
	Address string `json:"address" yaml:"address"`
	Amount  string `json:"amount" yaml:"amount"`
}

func MustUnmarshalVoter added in v0.8.0

func MustUnmarshalVoter(cdc *codec.Codec, value []byte) Voter

unmarshal a delegator from a store value

func NewVoter added in v0.8.0

func NewVoter(address string, amount string) Voter

NewVoter - initialize a new voter

func UnmarshalVoter added in v0.8.0

func UnmarshalVoter(cdc *codec.Codec, value []byte) (voter Voter, err error)

unmarshal a voter from a store value

func (Voter) String added in v0.8.0

func (d Voter) String() string

String returns a human readable string representation of a validator.

type Voters added in v0.8.0

type Voters []Voter

Voters is a collection of Delegator

func (Voters) String added in v0.8.0

func (d Voters) String() (out string)

type WasmCosts

type WasmCosts struct {
	Regular           uint32 `json:"regular" toml:"regular"`
	DivMultiplier     uint32 `json:"div_multiplier" toml:"div-multiplier"`
	MulMultiplier     uint32 `json:"mul_multiplier" toml:"mul-multiplier"`
	MemMultiplier     uint32 `json:"mem_multiplier" toml:"mem-multiplier"`
	MemInitialPages   uint32 `json:"mem_initial_pages" toml:"mem-initial-pages"`
	MemGrowPerPage    uint32 `json:"mem_grow_per_page" toml:"mem-grow-per-page"`
	MemCopyPerByte    uint32 `json:"mem_copy_per_byte" toml:"mem-copy-per-byte"`
	MaxStackHeight    uint32 `json:"max_stack_height" toml:"max-stack-height"`
	OpcodesMultiplier uint32 `json:"opcodes_multiplier" toml:"opcodes-multiplier"`
	OpcodesDivisor    uint32 `json:"opcodes_divisor" toml:"opcodes-divisor"`
}

WasmCosts : CasperLabs EE Wasm Cost table

Jump to

Keyboard shortcuts

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