asset

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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
	CodeInvalidField          sdk.CodeType      = 506
	CodeInvalidRevokeReporter sdk.CodeType      = 507
	CodeInvalidAssetQuantity  sdk.CodeType      = 508
	CodeAssetAlreadyFinal     sdk.CodeType      = 509
	CodeProposalNotFound      sdk.CodeType      = 510
	CodeInvalidRole           sdk.CodeType      = 511
	DefaultCodespace          sdk.CodespaceType = 10
)

ABCI Response Codes Base SDK reserves 500 - 599.

View Source
const (
	// TagAsset ...
	TagAsset = "asset_id"
	// TagSender ...
	TagSender = "sender"
	// TagRecipient ...
	TagRecipient = "recipient"
)

Variables

View Source
var (
	// Keys for store prefixes
	AssetKey            = []byte{0x00} // prefix for each key to an asset
	AccountAssetKey     = []byte{0x01} // prefix for each key to an account
	ProposalsKey        = []byte{0x02} // prefix for each key to an account a proposal
	AssetChildrenKey    = []byte{0x03} // prefix for each key to an asset parent a an asset child
	AccountProposalsKey = []byte{0x04} // prefix for each key to an account a proposal
	ReportersKey        = []byte{0x05}
	PropertiesKey       = []byte{0x06}
	InventoryKey        = []byte{0x07}
	ReporterAssetsKey   = []byte{0x08}
	ProposalsAccountKey = []byte{0x09}
	MaterialsKey        = []byte{0x0A}
)

nolint

Functions

func ErrAssetAlreadyFinal added in v0.2.1

func ErrAssetAlreadyFinal(assetID string) sdk.Error

ErrAssetAlreadyFinal ...

func ErrAssetNotFound added in v0.1.0

func ErrAssetNotFound(assetID string) sdk.Error

ErrAssetNotFound ...

func ErrInvalidAssetQuantity added in v0.2.1

func ErrInvalidAssetQuantity(assetID string) sdk.Error

ErrInvalidAssetQuantity ...

func ErrInvalidField added in v0.1.0

func ErrInvalidField(field string) sdk.Error

ErrInvalidField ...

func ErrInvalidRevokeReporter added in v0.2.2

func ErrInvalidRevokeReporter(addr sdk.AccAddress) sdk.Error

ErrInvalidRevokeReporter is used when the reporter of a revoke reporter message is not in the asset's reporter list

func ErrInvalidRole added in v0.22.4

func ErrInvalidRole(msg string) sdk.Error

ErrInvalidRole ...

func ErrInvalidTransaction added in v0.2.1

func ErrInvalidTransaction(msg string) sdk.Error

ErrInvalidTransaction ...

func ErrMissingField

func ErrMissingField(field string) sdk.Error

ErrMissingField ...

func ErrProposalNotFound added in v0.20.0

func ErrProposalNotFound(recipient sdk.AccAddress) sdk.Error

ErrProposalNotFound ...

func GetAccountAssetKey added in v0.2.2

func GetAccountAssetKey(addr sdk.AccAddress, assetID string) []byte

GetAccountAssetKey get the key for an account for an asset

func GetAccountAssetsKey added in v0.2.2

func GetAccountAssetsKey(addr sdk.AccAddress) []byte

GetAccountAssetsKey get the key for an account for all assets

func GetAssetChildrenKey added in v0.20.0

func GetAssetChildrenKey(parent, children string) []byte

GetAssetChilrenKey get the key for an asset for an asset

func GetAssetChildrensKey added in v0.20.0

func GetAssetChildrensKey(parent string) []byte

func GetAssetKey

func GetAssetKey(assetID string) []byte

GetAssetKey get the key for the record with address

func GetMaterialKey added in v0.22.4

func GetMaterialKey(recordID string, materialID string) []byte

GetMaterialKey ...

func GetMaterialsKey added in v0.22.4

func GetMaterialsKey(recordID string) []byte

GetMaterialsKey ...

func GetPropertiesKey added in v0.22.4

func GetPropertiesKey(recordID string) []byte

GetPropertiesKey ...

func GetPropertyKey added in v0.22.4

func GetPropertyKey(recordID, name string) []byte

GetPropertyKey ...

func GetProposalAccountKey added in v0.21.0

func GetProposalAccountKey(addr sdk.AccAddress, assetID string) []byte

GetProposalAccountKey ...

func GetProposalKey added in v0.20.0

func GetProposalKey(assetID string, recipient sdk.AccAddress) []byte

func GetProposalsAccountKey added in v0.21.0

func GetProposalsAccountKey(addr sdk.AccAddress) []byte

GetProposalsAccountKey ...

func GetProposalsKey added in v0.20.0

func GetProposalsKey(assetID string) []byte

func GetReporterAssetKey added in v0.21.0

func GetReporterAssetKey(addr sdk.AccAddress, assetID string) []byte

GetInventoryKey ...

func GetReporterAssetsKey added in v0.21.0

func GetReporterAssetsKey(addr sdk.AccAddress) []byte

GetInventoryKey ...

func GetReporterKey added in v0.22.4

func GetReporterKey(recordID string, addr sdk.AccAddress) []byte

GetReporterKey ...

func GetReportersKey added in v0.22.4

func GetReportersKey(recordID string) []byte

GetReportersKey ...

func NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler ...

func NewPubKey added in v0.20.0

func NewPubKey(pk string) (res ed25519.PubKeyEd25519)

func PropertyTypeToString added in v0.22.0

func PropertyTypeToString(t PropertyType) string

func RegisterWire added in v0.0.2

func RegisterWire(cdc *wire.Codec)

Register concrete types on wire codec

func TestAddr added in v0.20.0

func TestAddr(addr string, bech string) sdk.AccAddress

for incode address generation

func ValidatorByPowerIndexExists added in v0.20.0

func ValidatorByPowerIndexExists(ctx sdk.Context, keeper Keeper, power []byte) bool

does a certain by-power index record exist

Types

type Asset

type Asset struct {
	ID       string         `json:"id"`
	Name     string         `json:"name"`
	Owner    sdk.AccAddress `json:"owner"`
	Parent   string         `json:"parent"` // the id of the asset parent
	Root     string         `json:"root"`   // the id of the asset root
	Final    bool           `json:"final"`
	Quantity sdk.Int        `json:"quantity"`
	Unit     string         `json:"unit"`
	Created  int64          `json:"created"`
	Height   int64          `json:"height"`
}

Asset asset infomation

func UnmarshalRecord added in v0.22.4

func UnmarshalRecord(cdc *wire.Codec, value []byte) (record Asset, err error)

UnmarshalRecord ...

func (Asset) IsOwner

func (a Asset) IsOwner(addr sdk.AccAddress) bool

IsOwner check is owner of the asset

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

Keeper ...

func NewKeeper

func NewKeeper(key sdk.StoreKey, cdc *wire.Codec) Keeper

NewKeeper - Returns the Keeper

func (Keeper) AddMaterial added in v0.22.4

func (k Keeper) AddMaterial(ctx sdk.Context, recordID string, input Material)

AddMaterial ...

func (Keeper) AddMaterials added in v0.2.1

func (k Keeper) AddMaterials(ctx sdk.Context, msg MsgAddMaterials) (sdk.Tags, sdk.Error)

AddMaterials add materials to the asset

func (Keeper) AddProposal added in v0.20.0

func (k Keeper) AddProposal(ctx sdk.Context, msg MsgCreateProposal) (sdk.Tags, sdk.Error)

func (Keeper) AddQuantity

func (k Keeper) AddQuantity(ctx sdk.Context, msg MsgAddQuantity) (sdk.Tags, sdk.Error)

AddQuantity ...

func (Keeper) AnswerProposal added in v0.1.0

func (k Keeper) AnswerProposal(ctx sdk.Context, msg MsgAnswerProposal) (sdk.Tags, sdk.Error)

func (Keeper) CheckUpdateAttributeAuthorization added in v0.22.4

func (k Keeper) CheckUpdateAttributeAuthorization(ctx sdk.Context, record Asset, reporter Reporter, prop Property) bool

CheckUpdateAttributeAuthorization returns whether the address is authorized to update the attribute

func (Keeper) CreateAsset added in v0.2.1

func (k Keeper) CreateAsset(ctx sdk.Context, msg MsgCreateAsset) (sdk.Tags, sdk.Error)

CreateAsset create new an asset

func (Keeper) DeleteProposal added in v0.20.0

func (k Keeper) DeleteProposal(ctx sdk.Context, assetID string, recipient sdk.AccAddress)

func (Keeper) DeleteReporter added in v0.22.4

func (k Keeper) DeleteReporter(ctx sdk.Context, recordID string, reporter sdk.AccAddress)

DeleteReporter ...

func (Keeper) DeleteReporters added in v0.22.4

func (k Keeper) DeleteReporters(ctx sdk.Context, recordID string)

DeleteReporters ...

func (Keeper) Finalize added in v0.2.1

func (k Keeper) Finalize(ctx sdk.Context, msg MsgFinalize) (sdk.Tags, sdk.Error)

Finalize ...

func (Keeper) GetAsset

func (k Keeper) GetAsset(ctx sdk.Context, assetID string) (asset Asset, found bool)

GetAsset get asset by IDS

func (Keeper) GetMaterial added in v0.22.4

func (k Keeper) GetMaterial(ctx sdk.Context, recordID string, materialID string) (material Material, found bool)

GetMaterial ...

func (Keeper) GetMaterials added in v0.22.4

func (k Keeper) GetMaterials(ctx sdk.Context, recordID string) (materials []Material)

GetMaterials ...

func (Keeper) GetProperties added in v0.22.4

func (k Keeper) GetProperties(ctx sdk.Context, recordID string) (reporters Properties)

GetProperties ...

func (Keeper) GetProposal added in v0.20.0

func (k Keeper) GetProposal(ctx sdk.Context, assetID string, recipient sdk.AccAddress) (proposal Proposal, found bool)

func (Keeper) GetReporter added in v0.22.4

func (k Keeper) GetReporter(ctx sdk.Context, recordID string, addr sdk.AccAddress) (reporter Reporter, found bool)

GetReporter ...

func (Keeper) GetReporters added in v0.22.4

func (k Keeper) GetReporters(ctx sdk.Context, recordID string) (reporters []Reporter)

GetReporters ...

func (Keeper) RevokeReporter added in v0.2.2

func (k Keeper) RevokeReporter(ctx sdk.Context, msg MsgRevokeReporter) (sdk.Tags, sdk.Error)

RevokeReporter delete reporter

func (Keeper) SetAsset added in v0.2.2

func (k Keeper) SetAsset(ctx sdk.Context, asset Asset)

SetAsset set the main record holding asset details

func (Keeper) SetProperties added in v0.22.4

func (k Keeper) SetProperties(ctx sdk.Context, recordID string, props Properties)

SetProperties ...

func (Keeper) SetProperty added in v0.22.4

func (k Keeper) SetProperty(ctx sdk.Context, recordID string, property Property)

SetProperty ....

func (Keeper) SetProposal added in v0.20.0

func (k Keeper) SetProposal(ctx sdk.Context, assetID string, proposal Proposal)

func (Keeper) SetReporter added in v0.22.4

func (k Keeper) SetReporter(ctx sdk.Context, recordID string, reporter Reporter)

SetReporter ...

func (Keeper) SubtractQuantity

func (k Keeper) SubtractQuantity(ctx sdk.Context, msg MsgSubtractQuantity) (sdk.Tags, sdk.Error)

SubtractQuantity subtract quantity of the asset

func (Keeper) UpdateProperties added in v0.2.2

func (k Keeper) UpdateProperties(ctx sdk.Context, msg MsgUpdateProperties) (sdk.Tags, sdk.Error)

UpdateProperties ...

func (Keeper) ValidateUpdateProperties added in v0.22.4

func (k Keeper) ValidateUpdateProperties(ctx sdk.Context, record Asset, sender sdk.AccAddress, properties Properties) sdk.Error

ValidateUpdateProperties ...

type Location

type Location struct {
	Latitude  int64 `json:"latitude"`
	Longitude int64 `json:"longitude"`
}

type Material added in v0.1.0

type Material struct {
	RecordID string  `json:"record_id"`
	Amount   sdk.Int `json:"amount"`
}

Material ...

func UnmarshalMaterial added in v0.22.4

func UnmarshalMaterial(cdc *wire.Codec, value []byte) (material Material, err error)

UnmarshalMaterial ...

func (Material) ValidateBasic added in v0.22.4

func (m Material) ValidateBasic() sdk.Error

ValidateBasic ...

type Materials added in v0.1.0

type Materials []Material

Materials ...

func (Materials) ValidateBasic added in v0.22.4

func (ms Materials) ValidateBasic() sdk.Error

ValidateBasic ...

type MsgAddMaterials added in v0.1.0

type MsgAddMaterials struct {
	AssetID string         `json:"asset_id"`
	Sender  sdk.AccAddress `json:"sender"`
	Amount  Materials      `json:"amount"`
}

MsgAddMaterials ...

func (MsgAddMaterials) Get added in v0.1.0

func (msg MsgAddMaterials) Get(key interface{}) (value interface{})

func (MsgAddMaterials) GetSignBytes added in v0.1.0

func (msg MsgAddMaterials) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgAddMaterials) GetSigners added in v0.1.0

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

func (MsgAddMaterials) Type added in v0.1.0

func (msg MsgAddMaterials) Type() string

func (MsgAddMaterials) ValidateBasic added in v0.1.0

func (msg MsgAddMaterials) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgAddQuantity added in v0.2.2

type MsgAddQuantity struct {
	Sender   sdk.AccAddress `json:"sender"`
	AssetID  string         `json:"asset_id"`
	Quantity sdk.Int        `json:"quantity"`
}

MsgAddQuantity ... ---------------------------------------------------------------

func (MsgAddQuantity) Get added in v0.2.2

func (msg MsgAddQuantity) Get(key interface{}) (value interface{})

func (MsgAddQuantity) GetSignBytes added in v0.2.2

func (msg MsgAddQuantity) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgAddQuantity) GetSigners added in v0.2.2

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

func (MsgAddQuantity) Type added in v0.2.2

func (msg MsgAddQuantity) Type() string

func (MsgAddQuantity) ValidateBasic added in v0.2.2

func (msg MsgAddQuantity) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgAnswerProposal added in v0.20.0

type MsgAnswerProposal struct {
	AssetID   string         `json:"asset_id"`
	Sender    sdk.AccAddress `json:"sender"`
	Recipient sdk.AccAddress `json:"recipient"`
	Response  ProposalStatus `json:"response"`
	Role      ProposalRole   `json:"role"`
}

MsgAnswerProposal ...

func (MsgAnswerProposal) Get added in v0.20.0

func (msg MsgAnswerProposal) Get(key interface{}) (value interface{})

func (MsgAnswerProposal) GetSignBytes added in v0.20.0

func (msg MsgAnswerProposal) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgAnswerProposal) GetSigners added in v0.20.0

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

func (MsgAnswerProposal) Type added in v0.20.0

func (msg MsgAnswerProposal) Type() string

func (MsgAnswerProposal) ValidateBasic added in v0.20.0

func (msg MsgAnswerProposal) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgCreateAsset added in v0.2.1

type MsgCreateAsset struct {
	Sender     sdk.AccAddress `json:"sender"`
	AssetID    string         `json:"asset_id"`
	Name       string         `json:"name"`
	Quantity   sdk.Int        `json:"quantity"`
	Parent     string         `json:"parent"` // the id of the  parent asset
	Unit       string         `json:"unit"`
	Properties Properties     `json:"properties"`
}

MsgCreateAsset A really msg record create type, these fields are can be entirely arbitrary and custom to your message

func NewMsgCreateAsset added in v0.2.1

func NewMsgCreateAsset(sender sdk.AccAddress, id, name string, quantity sdk.Int, parent string) MsgCreateAsset

NewMsgCreateAsset new record create msg

func (MsgCreateAsset) Get added in v0.2.1

func (msg MsgCreateAsset) Get(key interface{}) (value interface{})

func (MsgCreateAsset) GetSignBytes added in v0.2.1

func (msg MsgCreateAsset) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgCreateAsset) GetSigners added in v0.2.1

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

func (MsgCreateAsset) Type added in v0.2.1

func (msg MsgCreateAsset) Type() string

nolint ...

func (MsgCreateAsset) ValidateBasic added in v0.2.1

func (msg MsgCreateAsset) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgCreateProposal added in v0.20.0

type MsgCreateProposal struct {
	AssetID    string         `json:"asset_id"`
	Sender     sdk.AccAddress `json:"sender"`
	Recipient  sdk.AccAddress `json:"recipient"`
	Properties []string       `json:"properties"`
	Role       ProposalRole   `json:"role"`
}

CreateProposalMsg ...

func (MsgCreateProposal) Get added in v0.20.0

func (msg MsgCreateProposal) Get(key interface{}) (value interface{})

func (MsgCreateProposal) GetSignBytes added in v0.20.0

func (msg MsgCreateProposal) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgCreateProposal) GetSigners added in v0.20.0

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

func (MsgCreateProposal) Type added in v0.20.0

func (msg MsgCreateProposal) Type() string

func (MsgCreateProposal) ValidateBasic added in v0.20.0

func (msg MsgCreateProposal) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgFinalize added in v0.2.1

type MsgFinalize struct {
	Sender  sdk.AccAddress `json:"sender"`
	AssetID string         `json:"asset_id"`
}

MsgSend ...

func (MsgFinalize) Get added in v0.2.1

func (msg MsgFinalize) Get(key interface{}) (value interface{})

func (MsgFinalize) GetSignBytes added in v0.2.1

func (msg MsgFinalize) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgFinalize) GetSigners added in v0.2.1

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

func (MsgFinalize) Type added in v0.2.1

func (msg MsgFinalize) Type() string

func (MsgFinalize) ValidateBasic added in v0.2.1

func (msg MsgFinalize) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgRevokeReporter added in v0.2.2

type MsgRevokeReporter struct {
	Sender   sdk.AccAddress `json:"sender"`
	Reporter sdk.AccAddress `json:"reporter"`
	AssetID  string         `json:"asset_id"`
}

MsgRevokeReporter ...

func (MsgRevokeReporter) Get added in v0.2.2

func (msg MsgRevokeReporter) Get(key interface{}) (value interface{})

func (MsgRevokeReporter) GetSignBytes added in v0.2.2

func (msg MsgRevokeReporter) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgRevokeReporter) GetSigners added in v0.2.2

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

func (MsgRevokeReporter) Type added in v0.2.2

func (msg MsgRevokeReporter) Type() string

func (MsgRevokeReporter) ValidateBasic added in v0.2.2

func (msg MsgRevokeReporter) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgSubtractQuantity added in v0.2.2

type MsgSubtractQuantity struct {
	Sender   sdk.AccAddress `json:"sender"`
	AssetID  string         `json:"asset_id"`
	Quantity sdk.Int        `json:"quantity"`
}

MsgSubtractQuantity ... ---------------------------------------------------------------

func (MsgSubtractQuantity) Get added in v0.2.2

func (msg MsgSubtractQuantity) Get(key interface{}) (value interface{})

func (MsgSubtractQuantity) GetSignBytes added in v0.2.2

func (msg MsgSubtractQuantity) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgSubtractQuantity) GetSigners added in v0.2.2

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

func (MsgSubtractQuantity) Type added in v0.2.2

func (msg MsgSubtractQuantity) Type() string

func (MsgSubtractQuantity) ValidateBasic added in v0.2.2

func (msg MsgSubtractQuantity) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type MsgUpdateProperties added in v0.2.2

type MsgUpdateProperties struct {
	Sender     sdk.AccAddress `json:"sender"`
	AssetID    string         `json:"asset_id"`
	Properties Properties     `json:"properties"`
}

MsgUpdateProperties ... ---------------------------------------------------------------

func (MsgUpdateProperties) Get added in v0.2.2

func (msg MsgUpdateProperties) Get(key interface{}) (value interface{})

func (MsgUpdateProperties) GetSignBytes added in v0.2.2

func (msg MsgUpdateProperties) GetSignBytes() []byte

GetSignBytes Get the bytes for the message signer to sign on

func (MsgUpdateProperties) GetSigners added in v0.2.2

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

func (MsgUpdateProperties) Type added in v0.2.2

func (msg MsgUpdateProperties) Type() string

func (MsgUpdateProperties) ValidateBasic added in v0.2.2

func (msg MsgUpdateProperties) ValidateBasic() sdk.Error

ValidateBasic Validate Basic is used to quickly disqualify obviously invalid messages quickly

type Properties added in v0.2.2

type Properties []Property

Properties list all properties

func (Properties) ValidateBasic added in v0.22.4

func (props Properties) ValidateBasic() sdk.Error

ValidateBasic ...

type Property added in v0.2.1

type Property struct {
	Name         string       `json:"name"`
	Type         PropertyType `json:"type"`
	BytesValue   []byte       `json:"bytes_value,omitempty"`
	StringValue  string       `json:"string_value,omitempty"`
	BooleanValue bool         `json:"boolean_value,omitempty"`
	NumberValue  int64        `json:"number_value,omitempty"`
	EnumValue    []string     `json:"enum_value,omitempty"`
	Location     Location     `json:"location_value,omitempty"`
}

Property property of the asset

func UnmarshalProperty added in v0.22.4

func UnmarshalProperty(cdc *wire.Codec, value []byte) (property Property, err error)

UnmarshalProperty ...

func (Property) GetValue added in v0.22.0

func (p Property) GetValue() interface{}

func (Property) ValidateBasic added in v0.22.4

func (p Property) ValidateBasic() sdk.Error

ValidateBasic ...

type PropertyType added in v0.2.2

type PropertyType int

PropertyType define the type of the property

const (
	PropertyTypeBytes PropertyType = iota + 1
	PropertyTypeString
	PropertyTypeBoolean
	PropertyTypeNumber
	PropertyTypeEnum
	PropertyTypeLocation
)

All avaliable type ò the attribute

type Proposal

type Proposal struct {
	Role       ProposalRole   `json:"role"`       // The role assigned to the recipient
	Status     ProposalStatus `json:"status"`     // The response of the recipient
	Properties []string       `json:"properties"` // The asset's attributes name that the recipient is authorized to update
	Issuer     sdk.AccAddress `json:"issuer"`     // The proposal issuer
	Recipient  sdk.AccAddress `json:"recipient"`  // The recipient of the proposal
}

Proposal is an invitation to manage an asset

func UnmarshalProposal added in v0.22.4

func UnmarshalProposal(cdc *wire.Codec, value []byte) (proposal Proposal, err error)

UnmarshalProposal ...

func (Proposal) ValidateAnswer added in v0.20.0

func (p Proposal) ValidateAnswer(msg MsgAnswerProposal) sdk.Error

type ProposalRole added in v0.1.0

type ProposalRole int

ProposalRole defines the authority of the proposal's recipient

const (
	// RoleReporter is authorized to update the asset's attributes
	// whose name is included in the proposal's properties field
	RoleReporter ProposalRole = iota + 1

	// RoleOwner has the same authorization as RoleReporter
	// but also authorized to make proposal to other recipient
	RoleOwner
)

type ProposalStatus added in v0.1.0

type ProposalStatus int

ProposalStatus define the status of the proposal

const (
	StatusPending  ProposalStatus = iota // The recipient has not answered
	StatusAccepted                       // The recipient accepted the proposal
	StatusCancel                         // The issuer cancel the proposal
	StatusRejected                       // the recipient reject the proposal
)

All available status of the proposal

type Proposals

type Proposals []Proposal

Proposals is a sclice of Proposal

type RecordOutput added in v0.22.4

type RecordOutput struct {
	ID         string         `json:"id"`
	Name       string         `json:"name"`
	Owner      sdk.AccAddress `json:"owner"`
	Type       string         `json:"type"`
	SubType    string         `json:"subtype"`
	Barcode    string         `json:"barcode"`
	Parent     string         `json:"parent"` // the id of the asset parent
	Root       string         `json:"root"`   // the id of the asset root
	Final      bool           `json:"final"`
	Quantity   sdk.Int        `json:"quantity"`
	Unit       string         `json:"unit"`
	Created    int64          `json:"created"`
	Height     int64          `json:"height"`
	Materials  []Material     `json:"materials"`
	Reporters  []Reporter     `json:"reporters"`
	Properties Properties     `json:"properties"`
}

RecordOutput ...

type Reporter added in v0.2.2

type Reporter struct {
	Addr       sdk.AccAddress `json:"address"`
	Properties []string       `json:"properties"`
	Created    int64          `json:"created"`
}

func UnmarshalReporter added in v0.22.4

func UnmarshalReporter(cdc *wire.Codec, value []byte) (reporter Reporter, err error)

UnmarshalReporter ...

type Reporters added in v0.2.2

type Reporters []Reporter

Reporters list all reporters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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