Documentation ¶
Index ¶
- Constants
- Variables
- func ErrBadDelegationAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrBadDelegationAmount(codespace sdk.CodespaceType) sdk.Error
- func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrDescriptionLength(codespace sdk.CodespaceType, descriptor string, got, max int) sdk.Error
- func ErrGRpcExecuteDeployExecError(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrGRpcExecuteDeployGasError(codespace sdk.CodespaceType) sdk.Error
- func ErrGRpcExecuteMissingParent(codespace sdk.CodespaceType, hash string) sdk.Error
- func ErrNilDelegatorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrNilValidatorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrProtocolVersionParse(codespace sdk.CodespaceType, protocolVersion string) sdk.Error
- func ErrPublicKeyDecode(codespace sdk.CodespaceType, publicKey string) sdk.Error
- func ErrTomlParse(codespace sdk.CodespaceType, keyString string) sdk.Error
- func GetEEStateKey(eeState []byte) []byte
- func GetValidatorKey(operatorAddr sdk.AccAddress) []byte
- func MustMarshalValidator(cdc *codec.Codec, validator Validator) []byte
- func RegisterCodec(cdc *codec.Codec)
- func ToChainSpecGenesisConfig(gs GenesisState) (*ipc.ChainSpec_GenesisConfig, error)
- func ToProtocolVersion(pvString string) (*state.ProtocolVersion, error)
- func ValidateGenesis(data GenesisState) error
- type Account
- type DeployConfig
- type Description
- type Genesis
- type GenesisConf
- type GenesisState
- type MsgBond
- type MsgCreateValidator
- func (msg MsgCreateValidator) GetSignBytes() []byte
- func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress
- func (msg MsgCreateValidator) MarshalJSON() ([]byte, error)
- func (msg MsgCreateValidator) Route() string
- func (msg MsgCreateValidator) Type() string
- func (msg *MsgCreateValidator) UnmarshalJSON(bz []byte) error
- func (msg MsgCreateValidator) ValidateBasic() sdk.Error
- type MsgEditValidator
- type MsgExecute
- type MsgTransfer
- type MsgUnBond
- type QueryExecutionLayer
- type QueryExecutionLayerDetail
- type QueryExecutionLayerResp
- type QueryGetBalance
- type QueryGetBalanceDetail
- type QueryValidatorParams
- type UnitHashMap
- type Validator
- type Validators
- type WasmCosts
Constants ¶
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 = 302 )
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" )
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
const DoNotModifyDesc = "[do-not-modify]"
constant used in flags to indicate that description field should not be updated
const RouterKey = ModuleName
RouterKey is not in sense yet
Variables ¶
var ( EEStateKey = []byte{0x11} ValidatorKey = []byte{0x21} )
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 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 GetEEStateKey ¶ added in v0.3.0
func GetValidatorKey ¶ added in v0.3.0
func GetValidatorKey(operatorAddr sdk.AccAddress) []byte
func MustMarshalValidator ¶ added in v0.3.0
return the redelegation
func RegisterCodec ¶
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)
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 DeployConfig ¶ added in v0.4.0
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"` 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"` }
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"` }
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) GenesisState
NewGenesisState creates a new genesis state.
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 uint64 `json:"amount" yaml:"amount"` Fee uint64 `json:"fee" yaml:"fee"` GasPrice uint64 `json:"gas_price" yaml:"gas_price"` }
______________________________________________________________________
func NewMsgBond ¶ added in v0.3.0
func NewMsgBond( tokenContractAddress string, bonderAddress sdk.AccAddress, amount, fee, gasPrice uint64, ) MsgBond
NewMsgBond is a constructor function for MsgSetName
func (MsgBond) GetSignBytes ¶ added in v0.3.0
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) ValidateBasic ¶ added in v0.3.0
ValidateBasic runs stateless checks on the message
type MsgCreateValidator ¶ added in v0.3.0
type MsgCreateValidator struct { ValidatorAddress sdk.AccAddress `json:"validator_address" yaml:"validator_address"` ConsPubKey crypto.PubKey `json:"cons_pubkey" yaml:"cons_pubkey"` Description Description `json:"description" yaml:"description"` }
______________________________________________________________________ MsgCreateValidator - struct for bonding transactions
func NewMsgCreateValidator ¶ added in v0.3.0
func NewMsgCreateValidator( valAddress sdk.AccAddress, consPubKey crypto.PubKey, description Description, ) 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 MsgEditValidator ¶ added in v0.5.0
type MsgEditValidator struct { ValidatorAddress sdk.AccAddress `json:"address" yaml:"address"` Description }
______________________________________________________________________ MsgEditValidator - struct for editing a validator
func NewMsgEditValidator ¶ added in v0.5.0
func NewMsgEditValidator(valAddr sdk.AccAddress, description Description) 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) 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 []byte `json:"session_args"` Fee uint64 `json:"fee"` GasPrice uint64 `json:"gas_price"` }
MsgExecute for sending deploy to execution engine
func NewMsgExecute ¶
func NewMsgExecute( contractAddress string, execAddress sdk.AccAddress, sessionType util.ContractType, sessionCode, sessionArgs []byte, fee, gasPrice uint64, ) 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) ValidateBasic ¶
func (msg MsgExecute) 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 uint64 `json:"amount" yaml:"amount"` Fee uint64 `json:"fee" yaml:"fee"` GasPrice uint64 `json:"gas_price" yaml:"gas_price"` }
MsgTransfer for sending deploy to execution engine
func NewMsgTransfer ¶ added in v0.3.0
func NewMsgTransfer( tokenContractAddress string, fromAddress, toAddress sdk.AccAddress, amount, fee, gasPrice uint64, ) 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 uint64 `json:"amount" yaml:"amount"` Fee uint64 `json:"fee" yaml:"fee"` GasPrice uint64 `json:"gas_price" yaml:"gas_price"` }
______________________________________________________________________
func NewMsgUnBond ¶ added in v0.3.0
func NewMsgUnBond( tokenContractAddress string, unbonderAddress sdk.AccAddress, amount, fee, gasPrice uint64, ) MsgUnBond
NewMsgUnBond is a constructor function for MsgSetName
func (MsgUnBond) GetSignBytes ¶ added in v0.3.0
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) ValidateBasic ¶ added in v0.3.0
ValidateBasic runs stateless checks on the message
type QueryExecutionLayer ¶
type QueryExecutionLayer struct { KeyType string `json:"key_type"` KeyData string `json:"key_data"` Path string `json:"path"` }
QueryExecutionLayer payload for a EE query
func (QueryExecutionLayer) String ¶
func (q QueryExecutionLayer) String() string
implement fmt.Stringer
type QueryExecutionLayerDetail ¶
type QueryExecutionLayerDetail struct { StateHash []byte `json:"state_hash"` 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 QueryExecutionLayerResp ¶
type QueryExecutionLayerResp struct {
Value string `json:"value"`
}
QueryExecutionLayerResp is used for response of EE query
func (QueryExecutionLayerResp) String ¶
func (q QueryExecutionLayerResp) String() string
implement fmt.Stringer
type QueryGetBalance ¶
type QueryGetBalance struct {
Address sdk.AccAddress
}
QueryGetBalance payload for balance query in the latest data
type QueryGetBalanceDetail ¶
type QueryGetBalanceDetail struct { StateHash []byte Address sdk.AccAddress }
QueryGetBalanceDetail payload for balance query
func (QueryGetBalanceDetail) String ¶
func (q QueryGetBalanceDetail) String() string
implement fmt.Stringer
type QueryValidatorParams ¶ added in v0.5.0
type QueryValidatorParams struct {
ValidatorAddr sdk.AccAddress
}
defines the params for the following queries: - 'custom/%s/validator'
func NewQueryValidatorParams ¶ added in v0.5.0
func NewQueryValidatorParams(validatorAddr sdk.AccAddress) QueryValidatorParams
type UnitHashMap ¶
type UnitHashMap struct {
EEState []byte `json:"ee_state"`
}
UnitHashMap used to define Unit account structure
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
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
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
MarshalJSON marshals the validator to JSON using Bech32
func (Validator) String ¶ added in v0.3.0
String returns a human readable string representation of a validator.
func (Validator) TestEquivalent ¶ added in v0.3.0
only the vitals
func (*Validator) UnmarshalJSON ¶ added in v0.3.0
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 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