Documentation ¶
Index ¶
- Constants
- Variables
- func BuildMsgDefineACL(from cTypes.AccAddress, to cTypes.AccAddress, aclAccount ACLAccount) cTypes.Msg
- func BuildMsgDefineACLWithACLs(msgs []DefineACL) cTypes.Msg
- func BuildMsgDefineOrganization(from cTypes.AccAddress, to cTypes.AccAddress, organizationID OrganizationID, ...) cTypes.Msg
- func BuildMsgDefineOrganizationWithMsgs(msgs []DefineOrganization) cTypes.Msg
- func BuildMsgDefineZone(from cTypes.AccAddress, to cTypes.AccAddress, zoneID ZoneID) cTypes.Msg
- func BuildMsgDefineZoneWithDefineZones(msgs []DefineZone) cTypes.Msg
- func ErrInvalidAddress(codespace cTypes.CodespaceType, msg string) cTypes.Error
- func ErrInvalidID(codespace cTypes.CodespaceType, msg string) cTypes.Error
- func ErrNoInputs(codespace cTypes.CodespaceType) cTypes.Error
- func GetACLAccountKey(address cTypes.AccAddress) []byte
- func GetOrganizationKey(id OrganizationID) []byte
- func GetZoneKey(id ZoneID) []byte
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type ACL
- type ACLAccount
- type ACLAccountDecoder
- type AccountKeeper
- type BaseACLAccount
- func (baseACLAccount BaseACLAccount) GetACL() ACL
- func (baseACLAccount BaseACLAccount) GetAddress() cTypes.AccAddress
- func (baseACLAccount BaseACLAccount) GetOrganizationID() OrganizationID
- func (baseACLAccount BaseACLAccount) GetZoneID() ZoneID
- func (baseACLAccount *BaseACLAccount) SetACL(acl ACL) error
- func (baseACLAccount *BaseACLAccount) SetAddress(address cTypes.AccAddress) error
- func (baseACLAccount *BaseACLAccount) SetOrganizationID(organizationID OrganizationID) error
- func (baseACLAccount *BaseACLAccount) SetZoneID(zoneID ZoneID) error
- func (baseACLAccount BaseACLAccount) String() string
- type CodeType
- type DefineACL
- type DefineOrganization
- type DefineZone
- type GenesisState
- type MsgDefineACLs
- type MsgDefineOrganizations
- type MsgDefineZones
- type OrgDecoder
- type Organization
- type OrganizationID
- type ZoneID
Constants ¶
const ( DefaultCodeSpace cTypes.CodespaceType = ModuleName CodeInvalidInputsOutputs cTypes.CodeType = 101 CodeInvalidID cTypes.CodeType = 102 CodeInvalidAddress cTypes.CodeType = 103 )
const ( ModuleName = "acl" StoreKey = ModuleName RouterKey = StoreKey QuerierRoute = RouterKey )
Variables ¶
var ( EventTypeDefineZone = "defineZone" EventTypeDefineOrganization = "defineOrganization" EventTypeDefineACL = "defineACL" AttributeKeyZoneAddress = "zoneAddress" AttributeKeyZoneID = "zoneID" AttributeKeyOrganizationAddress = "organizationAddress" AttributeKeyOrganizationID = "organizationID" AttributeACLAccountAddress = "aclAccountAddress" )
var ( ZoneKey = []byte{0x01} OrganizationKey = []byte{0x02} ACLKey = []byte{0x03} DefaultZoneID = []byte("zone") DefaultOrganizationID = []byte("organization") )
var ModuleCdc *codec.Codec
Functions ¶
func BuildMsgDefineACL ¶
func BuildMsgDefineACL(from cTypes.AccAddress, to cTypes.AccAddress, aclAccount ACLAccount) cTypes.Msg
BuildMsgDefineACL : build define acls message
func BuildMsgDefineACLWithACLs ¶
BuildMsgDefineACLWithACLs : build define acls message
func BuildMsgDefineOrganization ¶
func BuildMsgDefineOrganization(from cTypes.AccAddress, to cTypes.AccAddress, organizationID OrganizationID, zoneID ZoneID) cTypes.Msg
BuildMsgDefineOrganization : build define organization message
func BuildMsgDefineOrganizationWithMsgs ¶
func BuildMsgDefineOrganizationWithMsgs(msgs []DefineOrganization) cTypes.Msg
BuildMsgDefineOrganizationWithMsgs : build define organization message
func BuildMsgDefineZone ¶
func BuildMsgDefineZone(from cTypes.AccAddress, to cTypes.AccAddress, zoneID ZoneID) cTypes.Msg
BuildMsgDefineZone : build define zones message
func BuildMsgDefineZoneWithDefineZones ¶
func BuildMsgDefineZoneWithDefineZones(msgs []DefineZone) cTypes.Msg
BuildMsgDefineZoneWithDefineZones : build define zones message
func ErrInvalidAddress ¶
func ErrInvalidAddress(codespace cTypes.CodespaceType, msg string) cTypes.Error
func ErrInvalidID ¶
func ErrInvalidID(codespace cTypes.CodespaceType, msg string) cTypes.Error
func ErrNoInputs ¶
func ErrNoInputs(codespace cTypes.CodespaceType) cTypes.Error
func GetACLAccountKey ¶
func GetACLAccountKey(address cTypes.AccAddress) []byte
func GetOrganizationKey ¶
func GetOrganizationKey(id OrganizationID) []byte
func GetZoneKey ¶
func RegisterCodec ¶
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
Types ¶
type ACL ¶
type ACL struct { IssueAsset bool `json:"issueAsset" valid:"required~Mandatory parameter issueAssets missing"` IssueFiat bool `json:"issueFiat" valid:"required~Mandatory parameter issueFiats missing"` SendAsset bool `json:"sendAsset" valid:"required~Mandatory parameter sendAssets missing"` SendFiat bool `json:"sendFiat" valid:"required~Mandatory parameter sendFiats missing"` BuyerExecuteOrder bool `json:"buyerExecuteOrder" valid:"required~Mandatory parameter buyerExecuteOrder missing"` SellerExecuteOrder bool `json:"sellerExecuteOrder" valid:"required~Mandatory parameter sellerExecuteOrder missing"` ChangeBuyerBid bool `json:"changeBuyerBid" valid:"required~Mandatory parameter changeBuyerBid missing"` ChangeSellerBid bool `json:"changeSellerBid" valid:"required~Mandatory parameter changeSellerBid missing"` ConfirmBuyerBid bool `json:"confirmBuyerBid" valid:"required~Mandatory parameter confirmBuyerBid missing"` ConfirmSellerBid bool `json:"confirmSellerBid" valid:"required~Mandatory parameter confirmSellerBid missing"` Negotiation bool `json:"negotiation" valid:"required~Mandatory parameter negotiation missing"` RedeemFiat bool `json:"redeemFiat" valid:"required~Mandatory parameter redeemFiat missing"` RedeemAsset bool `json:"redeemAsset" valid:"required~Mandatory parameter redeemAsset missing"` ReleaseAsset bool `json:"releaseAsset" valid:"required~Mandatory parameter releaseAsset missing"` }
type ACLAccount ¶
type ACLAccount interface { GetAddress() cTypes.AccAddress SetAddress(address cTypes.AccAddress) error GetZoneID() ZoneID SetZoneID(id ZoneID) error GetOrganizationID() OrganizationID SetOrganizationID(id OrganizationID) error GetACL() ACL SetACL(acl ACL) error }
func ProtoBaseACLAccount ¶
func ProtoBaseACLAccount() ACLAccount
ProtoBaseACLAccount : prototype of acl account
type ACLAccountDecoder ¶
type ACLAccountDecoder func(aclbytes []byte) (ACLAccount, error)
ACLAccountDecoder : decoder function for acl account
type AccountKeeper ¶
type BaseACLAccount ¶
type BaseACLAccount struct { Address cTypes.AccAddress `` /* 160-byte string literal not displayed */ ZoneID ZoneID `json:"zoneID" valid:"required~matches(^[A-F0-9]+$)~Invalid TOAddress,length(2|40)~ToAddress length between 2-40"` OrganizationID OrganizationID `json:"organizationID" valid:"required~matches(^[A-F0-9]+$)~Invalid TOAddress,length(2|40)~ToAddress length between 2-40"` ACL ACL `json:"acl"` }
BaseACLAccount : Acl account type
func (BaseACLAccount) GetAddress ¶
func (baseACLAccount BaseACLAccount) GetAddress() cTypes.AccAddress
GetAddress : getter
func (BaseACLAccount) GetOrganizationID ¶
func (baseACLAccount BaseACLAccount) GetOrganizationID() OrganizationID
GetOrganizationID : getter
func (BaseACLAccount) GetZoneID ¶
func (baseACLAccount BaseACLAccount) GetZoneID() ZoneID
GetZoneID : getter
func (*BaseACLAccount) SetACL ¶
func (baseACLAccount *BaseACLAccount) SetACL(acl ACL) error
SetACL : setter
func (*BaseACLAccount) SetAddress ¶
func (baseACLAccount *BaseACLAccount) SetAddress(address cTypes.AccAddress) error
SetAddress : setter
func (*BaseACLAccount) SetOrganizationID ¶
func (baseACLAccount *BaseACLAccount) SetOrganizationID(organizationID OrganizationID) error
SetOrganizationID : setter
func (*BaseACLAccount) SetZoneID ¶
func (baseACLAccount *BaseACLAccount) SetZoneID(zoneID ZoneID) error
SetZoneID : setter
func (BaseACLAccount) String ¶
func (baseACLAccount BaseACLAccount) String() string
type DefineACL ¶
type DefineACL struct { From cTypes.AccAddress `json:"from"` To cTypes.AccAddress `json:"to"` ACLAccount ACLAccount `json:"aclAccount"` }
DefineACL : indular define acl message
func BuildMsgDefineACLs ¶
func BuildMsgDefineACLs(from cTypes.AccAddress, to cTypes.AccAddress, aclAccount ACLAccount, msgs []DefineACL) []DefineACL
BuildMsgDefineACLs : build define acls message
func NewDefineACL ¶
func NewDefineACL(from cTypes.AccAddress, to cTypes.AccAddress, aclAccount ACLAccount) DefineACL
NewDefineACL : new define acl struct
func (DefineACL) GetSignBytes ¶
GetSignBytes : get bytes to sign
func (DefineACL) ValidateBasic ¶
ValidateBasic : Validate Basic
type DefineOrganization ¶
type DefineOrganization struct { From cTypes.AccAddress `json:"from"` To cTypes.AccAddress `json:"to"` OrganizationID OrganizationID `json:"organizationID"` ZoneID ZoneID `json:"zoneID"` }
DefineOrganization : singular define organization message
func BuildMsgDefineOrganizations ¶
func BuildMsgDefineOrganizations(from cTypes.AccAddress, to cTypes.AccAddress, organizationID OrganizationID, zoneID ZoneID, msgs []DefineOrganization) []DefineOrganization
BuildMsgDefineOrganizations : build define organization message
func NewDefineOrganization ¶
func NewDefineOrganization(from cTypes.AccAddress, to cTypes.AccAddress, organizationID OrganizationID, zoneID ZoneID) DefineOrganization
NewDefineOrganization : new define organization struct
func (DefineOrganization) GetSignBytes ¶
func (in DefineOrganization) GetSignBytes() []byte
GetSignBytes : get bytes to sign
func (DefineOrganization) ValidateBasic ¶
func (in DefineOrganization) ValidateBasic() cTypes.Error
ValidateBasic : Validate Basic
type DefineZone ¶
type DefineZone struct { From cTypes.AccAddress `json:"from"` To cTypes.AccAddress `json:"to"` ZoneID ZoneID `json:"zoneID"` }
DefineZone : singular define zone message
func BuildMsgDefineZones ¶
func BuildMsgDefineZones(from cTypes.AccAddress, to cTypes.AccAddress, zoneID ZoneID, msgs []DefineZone) []DefineZone
BuildMsgDefineZones : build define zones message
func NewDefineZone ¶
func NewDefineZone(from cTypes.AccAddress, to cTypes.AccAddress, zoneID ZoneID) DefineZone
NewDefineZone : new define zone struct
func (DefineZone) GetSignBytes ¶
func (in DefineZone) GetSignBytes() []byte
GetSignBytes : get bytes to sign
func (DefineZone) ValidateBasic ¶
func (in DefineZone) ValidateBasic() cTypes.Error
ValidateBasic : Validate Basic
type GenesisState ¶
type GenesisState struct { Accounts []ACLAccount `json:"accounts"` ZoneID cTypes.AccAddress `json:"zone_id"` Organization Organization `json:"organization"` }
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(accounts []ACLAccount, zoneID cTypes.AccAddress, organization Organization) GenesisState
type MsgDefineACLs ¶
type MsgDefineACLs struct {
DefineACLs []DefineACL `json:"defineACLs"`
}
MsgDefineACLs : message define acls
func NewMsgDefineACLs ¶
func NewMsgDefineACLs(defineACLs []DefineACL) MsgDefineACLs
NewMsgDefineACLs : new message define acls
func (MsgDefineACLs) GetSignBytes ¶
func (msg MsgDefineACLs) GetSignBytes() []byte
GetSignBytes : implements msg
func (MsgDefineACLs) GetSigners ¶
func (msg MsgDefineACLs) GetSigners() []cTypes.AccAddress
GetSigners : implements msg
func (MsgDefineACLs) Route ¶
func (msg MsgDefineACLs) Route() string
func (MsgDefineACLs) ValidateBasic ¶
func (msg MsgDefineACLs) ValidateBasic() cTypes.Error
ValidateBasic : implements msg
type MsgDefineOrganizations ¶
type MsgDefineOrganizations struct {
DefineOrganizations []DefineOrganization `json:"defineOrganizations"`
}
MsgDefineOrganizations : message define organizations
func NewMsgDefineOrganizations ¶
func NewMsgDefineOrganizations(defineOrganizations []DefineOrganization) MsgDefineOrganizations
NewMsgDefineOrganizations : new message define organizations
func (MsgDefineOrganizations) GetSignBytes ¶
func (msg MsgDefineOrganizations) GetSignBytes() []byte
GetSignBytes : implements msg
func (MsgDefineOrganizations) GetSigners ¶
func (msg MsgDefineOrganizations) GetSigners() []cTypes.AccAddress
GetSigners : implements msg
func (MsgDefineOrganizations) Route ¶
func (msg MsgDefineOrganizations) Route() string
func (MsgDefineOrganizations) Type ¶
func (msg MsgDefineOrganizations) Type() string
Type : implements msg
func (MsgDefineOrganizations) ValidateBasic ¶
func (msg MsgDefineOrganizations) ValidateBasic() cTypes.Error
ValidateBasic : implements msg
type MsgDefineZones ¶
type MsgDefineZones struct {
DefineZones []DefineZone `json:"defineZones"`
}
MsgDefineZones : message define zones
func NewMsgDefineZones ¶
func NewMsgDefineZones(defineZones []DefineZone) MsgDefineZones
NewMsgDefineZones : new message define zones
func (MsgDefineZones) GetSignBytes ¶
func (msg MsgDefineZones) GetSignBytes() []byte
GetSignBytes : implements msg
func (MsgDefineZones) GetSigners ¶
func (msg MsgDefineZones) GetSigners() []cTypes.AccAddress
GetSigners : implements msg
func (MsgDefineZones) Route ¶
func (msg MsgDefineZones) Route() string
func (MsgDefineZones) ValidateBasic ¶
func (msg MsgDefineZones) ValidateBasic() cTypes.Error
ValidateBasic : implements msg
type OrgDecoder ¶
type OrgDecoder func(orgBytes []byte) (Organization, error)
type Organization ¶
type Organization struct { Address cTypes.AccAddress `json:"address"` ZoneID ZoneID `json:"zoneID"` }
func NewOrganization ¶
func NewOrganization(address cTypes.AccAddress, id ZoneID) Organization
func (Organization) String ¶
func (org Organization) String() string
type OrganizationID ¶
func GetOrganizationIDFromString ¶
func GetOrganizationIDFromString(organizationID string) (OrganizationID, error)