identity

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: 20 Imported by: 0

Documentation

Index

Constants

View Source
const MsgType = "identity"

name to idetify transaction types

Variables

View Source
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
)
View Source
var (
	KeyNextIdentityID = []byte{0x01}
	IdentitiesKey     = []byte{0x02}
)
View Source
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

func KeyIdentity(identityID int64) []byte

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 NewHandler

func NewHandler(k Keeper) sdk.Handler

NewHandler ...

func NewPubKey added in v0.20.0

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

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 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 (msg CertValue) GetSignBytes() []byte

func (CertValue) ValidateBasic added in v0.20.0

func (msg CertValue) ValidateBasic() sdk.Error

quick validity check

type Certs added in v0.20.0

type Certs []Cert

type Keeper

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

func NewKeeper

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

func (Keeper) AddCerts added in v0.20.0

func (k Keeper) AddCerts(ctx sdk.Context, msg MsgSetCerts) sdk.Error

add a trusting

func (Keeper) AddTrust added in v0.20.0

func (k Keeper) AddTrust(ctx sdk.Context, msg MsgSetTrust) sdk.Error

add a trust

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

func (Keeper) GetTrust added in v0.20.0

func (k Keeper) GetTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress) (trust Trust, found bool)

func (Keeper) SetCert added in v0.20.0

func (k Keeper) SetCert(ctx sdk.Context, addr sdk.AccAddress, cert Cert)

set the main record holding cert details

func (Keeper) SetTrust added in v0.20.0

func (k Keeper) SetTrust(ctx sdk.Context, trustor, trusting sdk.AccAddress)

set the main record holding trust details

type Metadata added in v0.2.2

type Metadata []byte

func (Metadata) MarshalJSON added in v0.20.0

func (j Metadata) MarshalJSON() ([]byte, error)

MarshalJSON returns *m as the JSON encoding of m.

func (*Metadata) UnmarshalJSON added in v0.20.0

func (j *Metadata) UnmarshalJSON(data []byte) error

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) Type added in v0.20.0

func (msg MsgSetCerts) Type() string

nolint

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) Type added in v0.20.0

func (msg MsgSetTrust) Type() string

nolint

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 Revocation struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

type Trust added in v0.20.0

type Trust struct {
	Trustor  sdk.AccAddress `json:"trustor"`
	Trusting sdk.AccAddress `json:"trusting"`
}

Directories

Path Synopsis
client

Jump to

Keyboard shortcuts

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