Documentation
¶
Index ¶
- Variables
- func GetContractKey(contractID string) []byte
- func NewHandler(k Keeper) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type Claim
- type ClaimStatus
- type Contract
- type Keeper
- func (k Keeper) CreateClaim(ctx sdk.Context, msg MsgCreateClaim) sdk.Error
- func (k Keeper) CreateContract(ctx sdk.Context, msg MsgCreateContract) sdk.Error
- func (k Keeper) GetContract(ctx sdk.Context, contractID string) *Contract
- func (k Keeper) ProcessClaim(ctx sdk.Context, msg MsgProcessClaim) sdk.Error
- type MsgCreateClaim
- func (msg MsgCreateClaim) Get(key interface{}) (value interface{})
- func (msg MsgCreateClaim) GetSignBytes() []byte
- func (msg MsgCreateClaim) GetSigners() []sdk.Address
- func (msg MsgCreateClaim) String() string
- func (msg MsgCreateClaim) Type() string
- func (msg MsgCreateClaim) ValidateBasic() sdk.Error
- type MsgCreateContract
- func (msg MsgCreateContract) Get(key interface{}) (value interface{})
- func (msg MsgCreateContract) GetSignBytes() []byte
- func (msg MsgCreateContract) GetSigners() []sdk.Address
- func (msg MsgCreateContract) String() string
- func (msg MsgCreateContract) Type() string
- func (msg MsgCreateContract) ValidateBasic() sdk.Error
- type MsgProcessClaim
- func (msg MsgProcessClaim) Get(key interface{}) (value interface{})
- func (msg MsgProcessClaim) GetSignBytes() []byte
- func (msg MsgProcessClaim) GetSigners() []sdk.Address
- func (msg MsgProcessClaim) String() string
- func (msg MsgProcessClaim) Type() string
- func (msg MsgProcessClaim) ValidateBasic() sdk.Error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Keys for store prefixes ContractKeyPrefix = []byte{0x00} // prefix for each key to a contract )
nolint
Functions ¶
func GetContractKey ¶
Types ¶
type Claim ¶
type Claim struct { Status ClaimStatus Recipient sdk.Address // warranty address }
Claim the claim of the contract
type ClaimStatus ¶
type ClaimStatus int
ClaimStatus status of a claim
const ( // The claim is pending ClaimStatusPending ClaimStatus = iota // The claim has been rejected ClaimStatusRejected // The item is up for repair or had been repaired ClaimStatusClaimRepair // The customer should be reimbursed ClaimStatusReimbursement // The theft of the item has been confirmed by authorities ClaimStatusTheftConfirmed )
type Contract ¶
type Contract struct { ID string `json:"id"` Issuer sdk.Address `json:"issuer"` Recipient sdk.Address `json:"recipient"` AssetID string `json:"asset_id"` // the id of asset Serial string `json:"serial"` // the serial of asset Expires time.Time `json:"expires"` Claim *Claim // the claim of contract }
Contract
func (Contract) ValidateClaimProcess ¶
func (c Contract) ValidateClaimProcess(addr sdk.Address, status ClaimStatus) (valid bool)
ValidateClaimProcess ...
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper manages contracts
func (Keeper) CreateClaim ¶
CreateClaim create new a claim
func (Keeper) CreateContract ¶
CreateContract create new a contract
func (Keeper) GetContract ¶
GetContract get contract by ID
func (Keeper) ProcessClaim ¶
ProcessClaim process claim
type MsgCreateClaim ¶
type MsgCreateClaim struct { ContractID string `json:"contract_id"` Issuer sdk.Address `json:"issuer"` Recipient sdk.Address `json:"recipient"` }
MsgCreateClaim --------------------------------------------------
func NewMsgCreateClaim ¶
func NewMsgCreateClaim(issuer, recipient sdk.Address, contractID string) MsgCreateClaim
func (MsgCreateClaim) Get ¶
func (msg MsgCreateClaim) Get(key interface{}) (value interface{})
func (MsgCreateClaim) GetSignBytes ¶
func (msg MsgCreateClaim) GetSignBytes() []byte
Implements Msg.
func (MsgCreateClaim) GetSigners ¶
func (msg MsgCreateClaim) GetSigners() []sdk.Address
func (MsgCreateClaim) String ¶
func (msg MsgCreateClaim) String() string
func (MsgCreateClaim) ValidateBasic ¶
func (msg MsgCreateClaim) ValidateBasic() sdk.Error
Implements Msg.
type MsgCreateContract ¶
type MsgCreateContract struct { ID string `json:"id"` Issuer sdk.Address `json:"issuer"` Recipient sdk.Address `json:"recipient"` Expires time.Time `json:"expires"` Serial string `json:"serial"` AssetID string `json:"asset_id"` }
MsgCreateContract --------------------------------------------------
func (MsgCreateContract) Get ¶
func (msg MsgCreateContract) Get(key interface{}) (value interface{})
func (MsgCreateContract) GetSignBytes ¶
func (msg MsgCreateContract) GetSignBytes() []byte
Implements Msg.
func (MsgCreateContract) GetSigners ¶
func (msg MsgCreateContract) GetSigners() []sdk.Address
func (MsgCreateContract) String ¶
func (msg MsgCreateContract) String() string
func (MsgCreateContract) ValidateBasic ¶
func (msg MsgCreateContract) ValidateBasic() sdk.Error
Implements Msg.
type MsgProcessClaim ¶
type MsgProcessClaim struct { ContractID string `json:"contract_id"` Issuer sdk.Address `json:"issuer"` Status ClaimStatus `json:"status"` }
MsgCompleteClaim --------------------------------------------------
func (MsgProcessClaim) Get ¶
func (msg MsgProcessClaim) Get(key interface{}) (value interface{})
func (MsgProcessClaim) GetSignBytes ¶
func (msg MsgProcessClaim) GetSignBytes() []byte
Implements Msg.
func (MsgProcessClaim) GetSigners ¶
func (msg MsgProcessClaim) GetSigners() []sdk.Address
func (MsgProcessClaim) String ¶
func (msg MsgProcessClaim) String() string
func (MsgProcessClaim) ValidateBasic ¶
func (msg MsgProcessClaim) ValidateBasic() sdk.Error
Implements Msg.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.