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(addr sdk.AccAddress, property string, certifier sdk.AccAddress) []byte
- func KeyCerts(addr sdk.AccAddress) []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 ed25519.PubKeyEd25519)
- 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 Keeper
- func (k Keeper) AddCerts(ctx sdk.Context, msg MsgSetCerts) sdk.Error
- func (k Keeper) AddTrust(ctx sdk.Context, msg MsgSetTrust) sdk.Error
- func (k Keeper) DeleteCert(ctx sdk.Context, addr sdk.AccAddress, property string, ...)
- func (k Keeper) DeleteTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress)
- func (k Keeper) GetCert(ctx sdk.Context, addr sdk.AccAddress, property string, ...) (cert Cert, found bool)
- func (k Keeper) GetTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress) (trust Trust, found bool)
- func (k Keeper) SetCert(ctx sdk.Context, addr sdk.AccAddress, cert Cert)
- func (k Keeper) SetTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress)
- type Metadata
- type MsgSetCerts
- type MsgSetTrust
- type Revocation
- 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(addr sdk.AccAddress, property string, certifier sdk.AccAddress) []byte
Key for getting a cert from the store
func KeyCerts ¶ added in v0.20.0
func KeyCerts(addr sdk.AccAddress) []byte
Key for getting all certs 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 NewPubKey ¶ added in v0.20.0
func NewPubKey(pk string) (res ed25519.PubKeyEd25519)
func RegisterWire ¶ added in v0.0.2
Register concrete types on wire codec
Types ¶
type Cert ¶ added in v0.20.0
type Cert struct { ID string `json:"id"` Context string `json:"context"` Property string `json:"property"` Certifier sdk.AccAddress `json:"certifier"` Owner sdk.AccAddress `json:"owner"` Trust bool `json:"trust"` Data Metadata `json:"data"` Confidence bool `json:"confidence"` Expires int64 `json:"expires"` CreatedAt int64 `json:"created_at"` Revocation Revocation `json:"revocation"` }
type CertValue ¶ added in v0.20.0
type CertValue struct { ID string `json:"id"` Context string `json:"context"` Property string `json:"property"` Data Metadata `json:"data"` Confidence bool `json:"confidence"` Expires int64 `json:"expires"` Revocation Revocation `json:"revocation"` }
func (CertValue) GetSignBytes ¶ added in v0.20.0
func (CertValue) ValidateBasic ¶ added in v0.20.0
quick validity check
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) DeleteCert ¶ added in v0.20.0
func (k Keeper) DeleteCert(ctx sdk.Context, addr sdk.AccAddress, property string, certifier sdk.AccAddress)
delete cert from the store
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, addr sdk.AccAddress, property string, certifier sdk.AccAddress) (cert Cert, found bool)
set the main record holding cert details
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 MsgSetCerts ¶ added in v0.20.0
type MsgSetCerts struct { Certifier sdk.AccAddress `json:"certifier"` Recipient sdk.AccAddress `json:"recipient"` Values []CertValue `json:"values"` }
MsgSetCerts struct for set certs
func NewMsgSetCerts ¶ added in v0.20.0
func NewMsgSetCerts(certifier sdk.AccAddress, recipient sdk.AccAddress, 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 Revocation ¶ added in v0.21.0
type Trust ¶ added in v0.20.0
type Trust struct { Trustor sdk.AccAddress `json:"trustor"` Trusting sdk.AccAddress `json:"trusting"` }