Documentation ¶
Index ¶
- Constants
- func BytesFromBase64(str string) []byte
- func BytesFromHex(str string) []byte
- func BytesToBase64(bytes []byte) string
- func BytesToHex(bytes []byte) string
- func GenRecordHash(r Record) []byte
- func GetAddressFromPubKey(pubKey crypto.PubKey) string
- func GetResourceSignature(record Record, name string) ([]byte, crypto.PubKey, error)
- func GraphResourceNode(g *dot.Graph, r Record) dot.Node
- func MarshalLinksToJSONBytes(val []map[string]interface{}) (bytes []byte)
- func MarshalMapToJSONBytes(val map[string]interface{}) (bytes []byte)
- func MarshalSliceToJSONBytes(val []interface{}) (bytes []byte)
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterCodec(cdc *codec.Codec)
- func UnMarshalLinksFromJSONBytes(bytes []byte) []map[string]interface{}
- func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{}
- func UnMarshalSliceFromJSONBytes(bytes []byte) []interface{}
- type ID
- type Keeper
- func (k Keeper) ClearResources(ctx sdk.Context)
- func (k Keeper) DeleteResource(ctx sdk.Context, id ID)
- func (k Keeper) GetResource(ctx sdk.Context, id ID) Record
- func (k Keeper) HasResource(ctx sdk.Context, id ID) bool
- func (k Keeper) ListResources(ctx sdk.Context) []Record
- func (k Keeper) PutResource(ctx sdk.Context, record Record)
- type MsgClearRecords
- type MsgDeleteRecord
- type MsgSetRecord
- type Payload
- type PayloadObj
- type Record
- type RecordObj
- type Signature
Constants ¶
const ( ListResources = "list" GetResource = "get" GetGraph = "graph" GetTest = "test" )
Endpoints supported by the Querier.
const WirelineChainID = "wireline"
WirelineChainID is the Cosmos SDK chain ID.
Variables ¶
This section is empty.
Functions ¶
func BytesFromBase64 ¶
BytesFromBase64 decodes a byte array from a base64 string.
func BytesFromHex ¶
BytesFromHex decodes a byte array from a hex string.
func BytesToBase64 ¶
BytesToBase64 encodes a byte array as a base64 string.
func BytesToHex ¶
BytesToHex encodes a byte array as a hex string.
func GenRecordHash ¶
GenRecordHash generates a transaction hash.
func GetAddressFromPubKey ¶
GetAddressFromPubKey gets an address from the public key.
func GetResourceSignature ¶
GetResourceSignature returns a cryptographic signature for a transaction.
func GraphResourceNode ¶
GraphResourceNode creates a node for a record.
func MarshalLinksToJSONBytes ¶
MarshalLinksToJSONBytes converts []map[string]interface{} to bytes.
func MarshalMapToJSONBytes ¶
MarshalMapToJSONBytes converts map[string]interface{} to bytes.
func MarshalSliceToJSONBytes ¶
func MarshalSliceToJSONBytes(val []interface{}) (bytes []byte)
MarshalSliceToJSONBytes converts map[string]interface{} to bytes.
func NewHandler ¶
NewHandler returns a handler for "utxo" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec.
func UnMarshalLinksFromJSONBytes ¶
UnMarshalLinksFromJSONBytes converts bytes to []map[string]interface{}.
func UnMarshalMapFromJSONBytes ¶
UnMarshalMapFromJSONBytes converts bytes to map[string]interface{}.
func UnMarshalSliceFromJSONBytes ¶
func UnMarshalSliceFromJSONBytes(bytes []byte) []interface{}
UnMarshalSliceFromJSONBytes converts bytes to map[string]interface{}.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine.
func NewKeeper ¶
func NewKeeper(accountKeeper auth.AccountKeeper, coinKeeper bank.Keeper, resourceStoreKey sdk.StoreKey, cdc *codec.Codec) Keeper
NewKeeper creates new instances of the UTXO Keeper.
func (Keeper) ClearResources ¶
ClearResources - Deletes all records. NOTE: FOR LOCAL TESTING PURPOSES ONLY!
func (Keeper) DeleteResource ¶
DeleteResource - deletes a record from the store.
func (Keeper) GetResource ¶
GetResource - gets a record from the store.
func (Keeper) HasResource ¶
HasResource - checks if a record by the given ID exists.
func (Keeper) ListResources ¶
ListResources - get all record records.
type MsgClearRecords ¶
type MsgClearRecords struct {
Signer sdk.AccAddress
}
MsgClearRecords defines a MsgClearRecords message.
func NewMsgClearRecords ¶
func NewMsgClearRecords(signer sdk.AccAddress) MsgClearRecords
NewMsgClearRecords is the constructor function for MsgClearRecords.
func (MsgClearRecords) GetSignBytes ¶
func (msg MsgClearRecords) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgClearRecords) GetSigners ¶
func (msg MsgClearRecords) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgClearRecords) ValidateBasic ¶
func (msg MsgClearRecords) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgDeleteRecord ¶
type MsgDeleteRecord struct { Payload PayloadObj Signer sdk.AccAddress }
MsgDeleteRecord defines a DeleteResource message.
func NewMsgDeleteRecord ¶
func NewMsgDeleteRecord(payload PayloadObj, signer sdk.AccAddress) MsgDeleteRecord
NewMsgDeleteRecord is the constructor function for MsgDeleteRecord.
func (MsgDeleteRecord) GetSignBytes ¶
func (msg MsgDeleteRecord) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgDeleteRecord) GetSigners ¶
func (msg MsgDeleteRecord) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgDeleteRecord) ValidateBasic ¶
func (msg MsgDeleteRecord) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgSetRecord ¶
type MsgSetRecord struct { Payload PayloadObj Signer sdk.AccAddress }
MsgSetRecord defines a SetResource message.
func NewMsgSetRecord ¶
func NewMsgSetRecord(payload PayloadObj, signer sdk.AccAddress) MsgSetRecord
NewMsgSetRecord is the constructor function for MsgSetRecord.
func (MsgSetRecord) GetSignBytes ¶
func (msg MsgSetRecord) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgSetRecord) GetSigners ¶
func (msg MsgSetRecord) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgSetRecord) ValidateBasic ¶
func (msg MsgSetRecord) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type Payload ¶
Payload represents a signed record payload that can be serialized from/to YAML.
func PayloadObjToPayload ¶
func PayloadObjToPayload(payloadObj PayloadObj) Payload
PayloadObjToPayload converts Payload to PayloadObj object. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
type PayloadObj ¶
type PayloadObj struct { Record RecordObj `json:"record"` Signatures []Signature `json:"signatures"` }
PayloadObj represents a signed record payload.
func PayloadToPayloadObj ¶
func PayloadToPayloadObj(payload Payload) PayloadObj
PayloadToPayloadObj converts Payload to PayloadObj object. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
type Record ¶
type Record struct { ID ID `json:"id"` Type string `json:"type"` Owner string `json:"owner"` // SystemAttributes map[string]interface{} `json:"systemAttributes"` Attributes map[string]interface{} `json:"attributes"` }
Record represents a registry record that can be serialized from/to YAML.
func RecordObjToRecord ¶
RecordObjToRecord convers RecordObj to Record. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
type RecordObj ¶
type RecordObj struct { ID ID `json:"id"` Type string `json:"type"` Owner string `json:"owner"` // SystemAttributes []byte `json:"systemAttributes"` Attributes []byte `json:"attributes"` }
RecordObj represents a registry record.
func RecordToRecordObj ¶
RecordToRecordObj convers Record to RecordObj. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.