Documentation
¶
Index ¶
- Constants
- Variables
- func CodeToDefaultMsg(code sdk.CodeType) string
- func ErrInvalidAssets(msg string) sdk.Error
- func ErrInvalidInput(msg string) sdk.Error
- func ErrInvalidOutput(msg string) sdk.Error
- func ErrMissingField(field string) sdk.Error
- func ErrNoInputs() sdk.Error
- func ErrNoOutputs() sdk.Error
- func ErrUnknownAsset(msg string) sdk.Error
- func GetAssetKey(uid []byte) []byte
- func InvalidTransaction(msg string) sdk.Error
- func NewHandler(k Keeper) sdk.Handler
- type AddQuantityMsg
- func (msg AddQuantityMsg) Get(key interface{}) (value interface{})
- func (msg AddQuantityMsg) GetSignBytes() []byte
- func (msg AddQuantityMsg) GetSigners() []sdk.Address
- func (msg AddQuantityMsg) String() string
- func (msg AddQuantityMsg) Type() string
- func (msg AddQuantityMsg) ValidateBasic() sdk.Error
- type AnswerProposalMsg
- func (msg AnswerProposalMsg) Get(key interface{}) (value interface{})
- func (msg AnswerProposalMsg) GetSignBytes() []byte
- func (msg AnswerProposalMsg) GetSigners() []sdk.Address
- func (msg AnswerProposalMsg) String() string
- func (msg AnswerProposalMsg) Type() string
- func (msg AnswerProposalMsg) ValidateBasic() sdk.Error
- type Asset
- type Attribute
- type CreateProposalMsg
- func (msg CreateProposalMsg) Get(key interface{}) (value interface{})
- func (msg CreateProposalMsg) GetSignBytes() []byte
- func (msg CreateProposalMsg) GetSigners() []sdk.Address
- func (msg CreateProposalMsg) String() string
- func (msg CreateProposalMsg) Type() string
- func (msg CreateProposalMsg) ValidateBasic() sdk.Error
- type Keeper
- func (k Keeper) AddQuantity(ctx sdk.Context, msg AddQuantityMsg) (sdk.Coins, types.Tags, sdk.Error)
- func (k Keeper) GetAsset(ctx sdk.Context, uid string) *Asset
- func (k Keeper) Has(ctx sdk.Context, id string) bool
- func (k Keeper) RegisterAsset(ctx sdk.Context, asset Asset) (sdk.Coins, types.Tags, sdk.Error)
- func (k Keeper) SubtractQuantity(ctx sdk.Context, msg SubtractQuantityMsg) (sdk.Coins, types.Tags, sdk.Error)
- func (k Keeper) UpdateAttribute(ctx sdk.Context, msg UpdateAttrMsg) (types.Tags, sdk.Error)
- type Location
- type Proposal
- type Proposals
- type RegisterMsg
- type RevokeProposalMsg
- func (msg RevokeProposalMsg) Get(key interface{}) (value interface{})
- func (msg RevokeProposalMsg) GetSignBytes() []byte
- func (msg RevokeProposalMsg) GetSigners() []sdk.Address
- func (msg RevokeProposalMsg) String() string
- func (msg RevokeProposalMsg) Type() string
- func (msg RevokeProposalMsg) ValidateBasic() sdk.Error
- type SubtractQuantityMsg
- func (msg SubtractQuantityMsg) Get(key interface{}) (value interface{})
- func (msg SubtractQuantityMsg) GetSignBytes() []byte
- func (msg SubtractQuantityMsg) GetSigners() []sdk.Address
- func (msg SubtractQuantityMsg) String() string
- func (msg SubtractQuantityMsg) Type() string
- func (msg SubtractQuantityMsg) ValidateBasic() sdk.Error
- type UpdateAttrMsg
Constants ¶
const ( CodeUnknownAsset sdk.CodeType = 500 CodeInvalidTransaction sdk.CodeType = 501 CodeInvalidInput sdk.CodeType = 502 CodeInvalidOutput sdk.CodeType = 503 CodeInvalidAssets sdk.CodeType = 504 CodeMissingField sdk.CodeType = 505 )
ABCI Response Codes Base SDK reserves 500 - 599.
Variables ¶
var ( // Keys for store prefixes AssetKey = []byte{0x00} // prefix for each key to a candidate )
nolint
Functions ¶
func CodeToDefaultMsg ¶
CodeToDefaultMsg NOTE: Don't stringer this, we'll put better messages in later.
func ErrInvalidAssets ¶
func ErrInvalidInput ¶
func ErrInvalidOutput ¶
func ErrNoInputs ¶
func ErrNoOutputs ¶
func GetAssetKey ¶
GetAssetKey get the key for the record with address
Types ¶
type AddQuantityMsg ¶
type AddQuantityMsg struct { Issuer sdk.Address `json:"issuer"` ID string `json:"id"` Quantity int64 `json:"quantity"` }
AddQuantityMsg ... ---------------------------------------------------------------
func (AddQuantityMsg) Get ¶
func (msg AddQuantityMsg) Get(key interface{}) (value interface{})
func (AddQuantityMsg) GetSignBytes ¶
func (msg AddQuantityMsg) GetSignBytes() []byte
GetSignBytes Get the bytes for the message signer to sign on
func (AddQuantityMsg) GetSigners ¶
func (msg AddQuantityMsg) GetSigners() []sdk.Address
func (AddQuantityMsg) String ¶
func (msg AddQuantityMsg) String() string
func (AddQuantityMsg) Type ¶
func (msg AddQuantityMsg) Type() string
func (AddQuantityMsg) ValidateBasic ¶
func (msg AddQuantityMsg) ValidateBasic() sdk.Error
ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly
type AnswerProposalMsg ¶
type AnswerProposalMsg struct { AssetID string `json:"asset_id"` Recipient sdk.Address `json:"recipient"` Response int `json:"response"` }
AnswerProposalMsg ...
func (AnswerProposalMsg) Get ¶
func (msg AnswerProposalMsg) Get(key interface{}) (value interface{})
func (AnswerProposalMsg) GetSignBytes ¶
func (msg AnswerProposalMsg) GetSignBytes() []byte
GetSignBytes Get the bytes for the message signer to sign on
func (AnswerProposalMsg) GetSigners ¶
func (msg AnswerProposalMsg) GetSigners() []sdk.Address
func (AnswerProposalMsg) String ¶
func (msg AnswerProposalMsg) String() string
func (AnswerProposalMsg) Type ¶
func (msg AnswerProposalMsg) Type() string
func (AnswerProposalMsg) ValidateBasic ¶
func (msg AnswerProposalMsg) ValidateBasic() sdk.Error
ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly
type Asset ¶
type Asset struct { ID string `json:"id"` Name string `json:"name"` Issuer sdk.Address `json:"issuer"` Quantity int64 `json:"quantity"` Company string `json:"company"` Email string `json:"email"` Attributes []Attribute `json:"attributes"` Proposals Proposals `json:"proposals"` }
Assets ...
type Attribute ¶
type Attribute struct { Name string `json:"name"` Type int `json:"type"` BytesValue []byte `json:"bytes_value"` StringValue string `json:"string_value"` BooleanValue bool `json:"boolean_value"` NumberValue int64 `json:"number_value"` EnumValue []string `json:"enum_value"` Location Location `json:"location_value"` }
Attribute ...
type CreateProposalMsg ¶
type CreateProposalMsg struct { AssetID string `json:"asset_id"` Issuer sdk.Address `json:"issuer"` Recipient sdk.Address `json:"recipient"` Propertipes []string `json:"propertipes"` }
CreateProposalMsg ...
func (CreateProposalMsg) Get ¶
func (msg CreateProposalMsg) Get(key interface{}) (value interface{})
func (CreateProposalMsg) GetSignBytes ¶
func (msg CreateProposalMsg) GetSignBytes() []byte
GetSignBytes Get the bytes for the message signer to sign on
func (CreateProposalMsg) GetSigners ¶
func (msg CreateProposalMsg) GetSigners() []sdk.Address
func (CreateProposalMsg) String ¶
func (msg CreateProposalMsg) String() string
func (CreateProposalMsg) Type ¶
func (msg CreateProposalMsg) Type() string
func (CreateProposalMsg) ValidateBasic ¶
func (msg CreateProposalMsg) ValidateBasic() sdk.Error
ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper ...
func (Keeper) AddQuantity ¶
AddQuantity ...
func (Keeper) RegisterAsset ¶
Register register new asset
func (Keeper) SubtractQuantity ¶
func (k Keeper) SubtractQuantity(ctx sdk.Context, msg SubtractQuantityMsg) (sdk.Coins, types.Tags, sdk.Error)
SubtractQuantity ...
func (Keeper) UpdateAttribute ¶
UpdateAttribute ...
type RegisterMsg ¶
type RegisterMsg struct { Issuer sdk.Address `json:"issuer"` ID string `json:"id"` Name string `json:"name"` Quantity int64 `json:"quantity"` // Company info Company string `json:"company"` Email string `json:"email"` }
RegisterMsg A really msg record create type, these fields are can be entirely arbitrary and custom to your message
func NewRegisterMsg ¶
func NewRegisterMsg(issuer sdk.Address, id, name string, quantity int64, company, email string) RegisterMsg
NewRegisterMsg new record create msg
func (RegisterMsg) Get ¶
func (msg RegisterMsg) Get(key interface{}) (value interface{})
func (RegisterMsg) GetSignBytes ¶
func (msg RegisterMsg) GetSignBytes() []byte
GetSignBytes Get the bytes for the message signer to sign on
func (RegisterMsg) GetSigners ¶
func (msg RegisterMsg) GetSigners() []sdk.Address
func (RegisterMsg) String ¶
func (msg RegisterMsg) String() string
func (RegisterMsg) ValidateBasic ¶
func (msg RegisterMsg) ValidateBasic() sdk.Error
ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly
type RevokeProposalMsg ¶
type RevokeProposalMsg struct { AssetID string `json:"asset_id"` Issuer sdk.Address `json:"issuer"` Recipient sdk.Address `json:"recipient"` Propertipes []string `json:"propertipes"` }
RevokeProposalMsg ...
func (RevokeProposalMsg) Get ¶
func (msg RevokeProposalMsg) Get(key interface{}) (value interface{})
func (RevokeProposalMsg) GetSignBytes ¶
func (msg RevokeProposalMsg) GetSignBytes() []byte
GetSignBytes Get the bytes for the message signer to sign on
func (RevokeProposalMsg) GetSigners ¶
func (msg RevokeProposalMsg) GetSigners() []sdk.Address
func (RevokeProposalMsg) String ¶
func (msg RevokeProposalMsg) String() string
func (RevokeProposalMsg) Type ¶
func (msg RevokeProposalMsg) Type() string
func (RevokeProposalMsg) ValidateBasic ¶
func (msg RevokeProposalMsg) ValidateBasic() sdk.Error
ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly
type SubtractQuantityMsg ¶
type SubtractQuantityMsg struct { Issuer sdk.Address `json:"issuer"` ID string `json:"id"` Quantity int64 `json:"quantity"` }
AddQuantityMsg ... ---------------------------------------------------------------
func (SubtractQuantityMsg) Get ¶
func (msg SubtractQuantityMsg) Get(key interface{}) (value interface{})
func (SubtractQuantityMsg) GetSignBytes ¶
func (msg SubtractQuantityMsg) GetSignBytes() []byte
GetSignBytes Get the bytes for the message signer to sign on
func (SubtractQuantityMsg) GetSigners ¶
func (msg SubtractQuantityMsg) GetSigners() []sdk.Address
func (SubtractQuantityMsg) String ¶
func (msg SubtractQuantityMsg) String() string
func (SubtractQuantityMsg) Type ¶
func (msg SubtractQuantityMsg) Type() string
func (SubtractQuantityMsg) ValidateBasic ¶
func (msg SubtractQuantityMsg) ValidateBasic() sdk.Error
ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly
type UpdateAttrMsg ¶
type UpdateAttrMsg struct { Issuer sdk.Address `json:"issuer"` ID string `json:"id"` Attributes []Attribute `json:"attribute"` }
UpdateAttrMsg ... ---------------------------------------------------------------
func (UpdateAttrMsg) Get ¶
func (msg UpdateAttrMsg) Get(key interface{}) (value interface{})
func (UpdateAttrMsg) GetSignBytes ¶
func (msg UpdateAttrMsg) GetSignBytes() []byte
GetSignBytes Get the bytes for the message signer to sign on
func (UpdateAttrMsg) GetSigners ¶
func (msg UpdateAttrMsg) GetSigners() []sdk.Address
func (UpdateAttrMsg) String ¶
func (msg UpdateAttrMsg) String() string
func (UpdateAttrMsg) Type ¶
func (msg UpdateAttrMsg) Type() string
func (UpdateAttrMsg) ValidateBasic ¶
func (msg UpdateAttrMsg) ValidateBasic() sdk.Error
ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly