Documentation ¶
Index ¶
- Constants
- Variables
- func ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrNilTrustingAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrNilTrustorAddr(codespace sdk.CodespaceType) sdk.Error
- func ErrUnknownIdentity(codespace sdk.CodespaceType, identityID int64) sdk.Error
- func KeyCert(identityID int64, property string, certifier sdk.AccAddress) []byte
- func KeyCerts(identityID int64, property string) []byte
- func KeyClaimedIdentity(address sdk.AccAddress) []byte
- func KeyIdentitiesByOwnerIndex(owner sdk.AccAddress) []byte
- func KeyIdentity(identityID int64) []byte
- func KeyIdentityByOwnerIndex(owner sdk.AccAddress, identityID int64) []byte
- func KeyTrust(trustor, trusting sdk.AccAddress) []byte
- func KeyTrusts(trustor sdk.AccAddress) []byte
- func NewHandler(k Keeper) sdk.Handler
- func NewPubKey(pk string) (res crypto.PubKey)
- func RegisterWire(cdc *wire.Codec)
- func TestAddr(addr string, bech string) sdk.AccAddress
- func ValidatorByPowerIndexExists(ctx sdk.Context, keeper Keeper, power []byte) bool
- type Cert
- type CertValue
- type Certs
- type Identity
- type Keeper
- func (k Keeper) AddCerts(ctx sdk.Context, msg MsgSetCerts) sdk.Error
- func (k Keeper) AddIdentity(ctx sdk.Context, msg MsgCreateIdentity) sdk.Error
- func (k Keeper) AddTrust(ctx sdk.Context, msg MsgSetTrust) sdk.Error
- func (k Keeper) DeleteCert(ctx sdk.Context, identity int64, property string, certifier sdk.AccAddress)
- func (k Keeper) DeleteClaimedIdentity(ctx sdk.Context, account sdk.AccAddress, identityID int64)
- func (k Keeper) DeleteTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress)
- func (k Keeper) GetCert(ctx sdk.Context, identity int64, property string, certifier sdk.AccAddress) (cert Cert, found bool)
- func (k Keeper) GetIdentity(ctx sdk.Context, identityID int64) (Identity, bool)
- func (k Keeper) GetTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress) (trust Trust, found bool)
- func (k Keeper) HasClaimedIdentity(ctx sdk.Context, account sdk.AccAddress, identityID int64) bool
- func (k Keeper) NewIdentity(ctx sdk.Context, owner sdk.AccAddress) Identity
- func (k Keeper) SetCert(ctx sdk.Context, identity int64, cert Cert)
- func (k Keeper) SetClaimedIdentity(ctx sdk.Context, account sdk.AccAddress, identity Identity)
- func (k Keeper) SetIdentity(ctx sdk.Context, identity Identity)
- func (k Keeper) SetIdentityByOwnerIndex(ctx sdk.Context, identity Identity)
- func (k Keeper) SetTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress)
- type Metadata
- type MsgCreateIdentity
- type MsgSetCerts
- type MsgSetTrust
- type Trust
Constants ¶
const MsgType = "identity"
name to idetify transaction types
Variables ¶
var ( DefaultCodespace sdk.CodespaceType = 12 CodeUnknownIdentity sdk.CodeType = 1 CodeInvalidGenesis sdk.CodeType = 2 CodeInvalidTrustor sdk.CodeType = 3 CodeInvalidTrusting sdk.CodeType = 4 CodeInvalidInput sdk.CodeType = 5 )
var ( KeyNextIdentityID = []byte{0x01} IdentitiesKey = []byte{0x02} )
var MsgCdc *wire.Codec
generic sealed codec to be used throughout sdk
Functions ¶
func ErrInvalidGenesis ¶ added in v0.20.0
func ErrInvalidGenesis(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrNilTrustingAddr ¶ added in v0.20.0
func ErrNilTrustingAddr(codespace sdk.CodespaceType) sdk.Error
func ErrNilTrustorAddr ¶ added in v0.20.0
func ErrNilTrustorAddr(codespace sdk.CodespaceType) sdk.Error
validator
func ErrUnknownIdentity ¶ added in v0.20.0
func ErrUnknownIdentity(codespace sdk.CodespaceType, identityID int64) sdk.Error
func KeyCert ¶ added in v0.20.0
func KeyCert(identityID int64, property string, certifier sdk.AccAddress) []byte
Key for getting a cert from the store
func KeyClaimedIdentity ¶ added in v0.20.0
func KeyClaimedIdentity(address sdk.AccAddress) []byte
func KeyIdentitiesByOwnerIndex ¶ added in v0.20.0
func KeyIdentitiesByOwnerIndex(owner sdk.AccAddress) []byte
func KeyIdentity ¶ added in v0.20.0
Key for getting a identity from the store
func KeyIdentityByOwnerIndex ¶ added in v0.20.0
func KeyIdentityByOwnerIndex(owner sdk.AccAddress, identityID int64) []byte
Key for getting a identity id of the account from the store
func KeyTrust ¶ added in v0.20.0
func KeyTrust(trustor, trusting sdk.AccAddress) []byte
Key for getting all trusting from the store
func KeyTrusts ¶ added in v0.20.0
func KeyTrusts(trustor sdk.AccAddress) []byte
func RegisterWire ¶ added in v0.0.2
Register concrete types on wire codec
Types ¶
type CertValue ¶ added in v0.20.0
type CertValue struct { Property string `json:"property"` Type string `json:"type"` Data Metadata `json:"data"` Confidence bool `json:"confidence"` }
func (CertValue) GetSignBytes ¶ added in v0.20.0
func (CertValue) ValidateBasic ¶ added in v0.20.0
quick validity check
type Identity ¶ added in v0.20.0
type Identity struct { ID int64 `json:"id"` // id of the identity Owner sdk.AccAddress `json:"owner"` // owner of the identity }
Identity
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) AddIdentity ¶ added in v0.20.0
AddIdentity add new an identity
func (Keeper) DeleteCert ¶ added in v0.20.0
func (k Keeper) DeleteCert(ctx sdk.Context, identity int64, property string, certifier sdk.AccAddress)
delete cert from the store
func (Keeper) DeleteClaimedIdentity ¶ added in v0.20.0
func (Keeper) DeleteTrust ¶ added in v0.20.0
func (k Keeper) DeleteTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress)
delete cert from the store
func (Keeper) GetCert ¶ added in v0.20.0
func (k Keeper) GetCert(ctx sdk.Context, identity int64, property string, certifier sdk.AccAddress) (cert Cert, found bool)
set the main record holding cert details
func (Keeper) GetIdentity ¶ added in v0.20.0
Get Identity from store by identityID
func (Keeper) HasClaimedIdentity ¶ added in v0.20.0
func (Keeper) NewIdentity ¶ added in v0.20.0
func (Keeper) SetClaimedIdentity ¶ added in v0.20.0
func (Keeper) SetIdentity ¶ added in v0.20.0
set the main record holding identity details
func (Keeper) SetIdentityByOwnerIndex ¶ added in v0.20.0
set the main record holding
type Metadata ¶ added in v0.2.2
type Metadata []byte
func (Metadata) MarshalJSON ¶ added in v0.20.0
MarshalJSON returns *m as the JSON encoding of m.
func (*Metadata) UnmarshalJSON ¶ added in v0.20.0
UnmarshalJSON sets *m to a copy of data.
type MsgCreateIdentity ¶ added in v0.20.0
type MsgCreateIdentity struct {
Sender sdk.AccAddress `json:"sender"`
}
MsgCreateIdentity struct for create identity
func NewMsgCreateIdentity ¶ added in v0.20.0
func NewMsgCreateIdentity(sender sdk.AccAddress) MsgCreateIdentity
func (MsgCreateIdentity) GetSignBytes ¶ added in v0.20.0
func (msg MsgCreateIdentity) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgCreateIdentity) GetSigners ¶ added in v0.20.0
func (msg MsgCreateIdentity) GetSigners() []sdk.AccAddress
func (MsgCreateIdentity) ValidateBasic ¶ added in v0.20.0
func (msg MsgCreateIdentity) ValidateBasic() sdk.Error
quick validity check
type MsgSetCerts ¶ added in v0.20.0
type MsgSetCerts struct { Certifier sdk.AccAddress `json:"certifier"` IdentityID int64 `json:"identity_id"` Values []CertValue `json:"values"` }
MsgSetCerts struct for set certs
func NewMsgSetCerts ¶ added in v0.20.0
func NewMsgSetCerts(certifier sdk.AccAddress, identityID int64, values []CertValue) MsgSetCerts
func (MsgSetCerts) GetSignBytes ¶ added in v0.20.0
func (msg MsgSetCerts) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgSetCerts) GetSigners ¶ added in v0.20.0
func (msg MsgSetCerts) GetSigners() []sdk.AccAddress
func (MsgSetCerts) ValidateBasic ¶ added in v0.20.0
func (msg MsgSetCerts) ValidateBasic() sdk.Error
quick validity check
type MsgSetTrust ¶ added in v0.20.0
type MsgSetTrust struct { Trustor sdk.AccAddress `json:"trustor"` Trusting sdk.AccAddress `json:"trusting"` Trust bool `json:"trust"` }
MsgSetTrust struct for set trust
func NewMsgSetTrust ¶ added in v0.20.0
func NewMsgSetTrust(trustor, trusting sdk.AccAddress, trust bool) MsgSetTrust
func (MsgSetTrust) GetSignBytes ¶ added in v0.20.0
func (msg MsgSetTrust) GetSignBytes() []byte
get the bytes for the message signer to sign on
func (MsgSetTrust) GetSigners ¶ added in v0.20.0
func (msg MsgSetTrust) GetSigners() []sdk.AccAddress
func (MsgSetTrust) ValidateBasic ¶ added in v0.20.0
func (msg MsgSetTrust) ValidateBasic() sdk.Error
quick validity check
type Trust ¶ added in v0.20.0
type Trust struct { Trustor sdk.AccAddress `json:"trustor"` Trusting sdk.AccAddress `json:"trusting"` }