types

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName      = "domain"
	DomainStoreKey  = "domain"
	AccountStoreKey = "account"
	IndexStoreKey   = ModuleName + "index"
	RouterKey       = ModuleName
	QuerierRoute    = ModuleName
)

Module names

View Source
const (
	// QueryDomain is the query route used to get a domain by its name
	QueryDomain = "get"
)

Module Queries

Variables

View Source
var ErrAccountDoesNotExist = sdkerrors.Register(ModuleName, 6, "account does not exist")
View Source
var ErrAccountExists = sdkerrors.Register(ModuleName, 12, "account already exists")
View Source
var ErrAccountExpired = sdkerrors.Register(ModuleName, 7, "account has expired")
View Source
var ErrCertificateDoesNotExist = sdkerrors.Register(ModuleName, 15, "certificate does not exist")
View Source
var ErrCertificateExists = sdkerrors.Register(ModuleName, 14, "certificate already exists")
View Source
var ErrDomainAlreadyExists = sdkerrors.Register(ModuleName, 2, "domain already exists")
View Source
var ErrDomainDoesNotExist = sdkerrors.Register(ModuleName, 5, "domain does not exist")
View Source
var ErrDomainExpired = sdkerrors.Register(ModuleName, 11, "domain has expired")
View Source
var ErrInvalidAccountName = sdkerrors.Register(ModuleName, 9, "invalid account name")
View Source
var ErrInvalidBlockchainTarget = sdkerrors.Register(ModuleName, 10, "blockchain target provided is not valid")
View Source
var ErrInvalidDomainName = sdkerrors.Register(ModuleName, 1, "domain name provided is invalid")
View Source
var ErrInvalidOwner = sdkerrors.Register(ModuleName, 8, "invalid owner")
View Source
var ErrInvalidRegisterDomainRequest = sdkerrors.Register(ModuleName, 4, "register domain request is not valid")
View Source
var ErrInvalidRequest = sdkerrors.Register(ModuleName, 13, "malformed request")
View Source
var ErrUnauthorized = sdkerrors.Register(ModuleName, 3, "operation unauthorized")
View Source
var ModuleCdc = codec.New()

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type Account

type Account struct {
	// Domain references the domain this account belongs to
	Domain string
	// Name is the name of the account
	Name string
	// Owner is the address that owns the account
	Owner sdk.AccAddress
	// ValidUntil defines a unix timestamp of the expiration of the account
	ValidUntil int64
	// Targets is the list of blockchain addresses this account belongs to
	Targets []iovns.BlockchainAddress
	// Certificates contains the list of certificates to identify the account owner
	Certificates [][]byte
	// Broker can be empty
	// it identifies an entity that facilitated the transaction of the account
	Broker sdk.AccAddress
}

Account defines an account that belongs to a domain

type Domain

type Domain struct {
	// Name is the name of the domain
	Name string
	// Admin is the owner of the domain
	Admin sdk.AccAddress
	// ValidUntil is a unix timestamp that defines for how long the domain is valid
	ValidUntil int64
	// HasSuperuser checks if the domain is owned by a super user or not
	HasSuperuser bool
	// AccountRenew defines the duration of each created or renewed account
	// under the domain
	AccountRenew time.Duration
	// Broker TODO needs comment
	Broker sdk.AccAddress
}

Domain defines a domain

func (Domain) String

func (d Domain) String() string

type MsgAddAccountCertificates

type MsgAddAccountCertificates struct {
	Domain         string
	Name           string
	Owner          sdk.AccAddress
	NewCertificate []byte
}

func (*MsgAddAccountCertificates) GetSignBytes

func (m *MsgAddAccountCertificates) GetSignBytes() []byte

func (*MsgAddAccountCertificates) GetSigners

func (m *MsgAddAccountCertificates) GetSigners() []sdk.AccAddress

func (*MsgAddAccountCertificates) Route

func (m *MsgAddAccountCertificates) Route() string

func (*MsgAddAccountCertificates) Type

func (*MsgAddAccountCertificates) ValidateBasic

func (m *MsgAddAccountCertificates) ValidateBasic() error

type MsgDeleteAccount

type MsgDeleteAccount struct {
	Domain string
	Name   string
	Owner  sdk.AccAddress
}

func (*MsgDeleteAccount) GetSignBytes

func (m *MsgDeleteAccount) GetSignBytes() []byte

GetSignBytes returns an ordered json of the request

func (*MsgDeleteAccount) GetSigners

func (m *MsgDeleteAccount) GetSigners() []sdk.AccAddress

GetSigners returns the list of address that should list the request in this case the admin of the domain

func (*MsgDeleteAccount) Route

func (m *MsgDeleteAccount) Route() string

Route returns the name of the module

func (*MsgDeleteAccount) Type

func (m *MsgDeleteAccount) Type() string

Type returns the action

func (*MsgDeleteAccount) ValidateBasic

func (m *MsgDeleteAccount) ValidateBasic() error

ValidateBasic does stateless checks on the request

type MsgDeleteAccountCertificate

type MsgDeleteAccountCertificate struct {
	Domain            string
	Name              string
	DeleteCertificate []byte
	Owner             sdk.AccAddress
}

func (*MsgDeleteAccountCertificate) GetSignBytes

func (m *MsgDeleteAccountCertificate) GetSignBytes() []byte

func (*MsgDeleteAccountCertificate) GetSigners

func (m *MsgDeleteAccountCertificate) GetSigners() []sdk.AccAddress

func (*MsgDeleteAccountCertificate) Route

func (*MsgDeleteAccountCertificate) Type

func (*MsgDeleteAccountCertificate) ValidateBasic

func (m *MsgDeleteAccountCertificate) ValidateBasic() error

type MsgDeleteDomain

type MsgDeleteDomain struct {
	Domain string
	Owner  sdk.AccAddress
}

func (*MsgDeleteDomain) GetSignBytes

func (m *MsgDeleteDomain) GetSignBytes() []byte

func (*MsgDeleteDomain) GetSigners

func (m *MsgDeleteDomain) GetSigners() []sdk.AccAddress

func (*MsgDeleteDomain) Route

func (m *MsgDeleteDomain) Route() string

func (*MsgDeleteDomain) Type

func (m *MsgDeleteDomain) Type() string

func (*MsgDeleteDomain) ValidateBasic

func (m *MsgDeleteDomain) ValidateBasic() error

type MsgFlushDomain

type MsgFlushDomain struct {
	Domain string
	Owner  sdk.AccAddress
}

MsgFlushDomain is used to flush a domain

func (*MsgFlushDomain) GetSignBytes

func (m *MsgFlushDomain) GetSignBytes() []byte

func (*MsgFlushDomain) GetSigners

func (m *MsgFlushDomain) GetSigners() []sdk.AccAddress

func (*MsgFlushDomain) Route

func (m *MsgFlushDomain) Route() string

func (*MsgFlushDomain) Type

func (m *MsgFlushDomain) Type() string

func (*MsgFlushDomain) ValidateBasic

func (m *MsgFlushDomain) ValidateBasic() error

type MsgRegisterAccount

type MsgRegisterAccount struct {
	Domain  string
	Name    string
	Owner   sdk.AccAddress
	Targets []iovns.BlockchainAddress
	Broker  sdk.AccAddress
}

func (*MsgRegisterAccount) GetSignBytes

func (m *MsgRegisterAccount) GetSignBytes() []byte

GetSignBytes returns the expected signature

func (*MsgRegisterAccount) GetSigners

func (m *MsgRegisterAccount) GetSigners() []sdk.AccAddress

GetSigners returns the expected signers of the request

func (*MsgRegisterAccount) Route

func (m *MsgRegisterAccount) Route() string

Route returns the route key for the request

func (*MsgRegisterAccount) Type

func (m *MsgRegisterAccount) Type() string

Type returns the type of the msg

func (*MsgRegisterAccount) ValidateBasic

func (m *MsgRegisterAccount) ValidateBasic() error

ValidateBasic checks the request in a stateless way

type MsgRegisterDomain

type MsgRegisterDomain struct {
	// Name is the name of the domain we want to register
	Name string `json:"domain" arg:"--domain" helper:"name of the domain"`
	// Admin is the address of the newly registered domain
	Admin sdk.AccAddress `json:"admin"`
	// HasSuperuser defines if the domain registered has an owner or not
	HasSuperuser bool `json:"has_superuser"`
	// Broker TODO document
	Broker sdk.AccAddress `json:"broker" arg:"--broker" helper:"the broker"`
	// AccountRenew defines the expiration time in seconds of each newly registered account.
	AccountRenew int64 `json:"account_renew" arg:"--account-renew" helper:"account's renewal time in seconds"`
}

MsgRegisterDomain is the request used to register new domains

func (*MsgRegisterDomain) GetSignBytes

func (m *MsgRegisterDomain) GetSignBytes() []byte

GetSignBytes returns an ordered json of the request

func (*MsgRegisterDomain) GetSigners

func (m *MsgRegisterDomain) GetSigners() []sdk.AccAddress

GetSigners returns the list of address that should list the request in this case the admin of the domain

func (*MsgRegisterDomain) Route

func (m *MsgRegisterDomain) Route() string

Route returns the name of the module

func (*MsgRegisterDomain) Type

func (m *MsgRegisterDomain) Type() string

Type returns the action

func (*MsgRegisterDomain) ValidateBasic

func (m *MsgRegisterDomain) ValidateBasic() error

ValidateBasic does stateless checks on the request it checks if the domain name is valid

type MsgRenewAccount

type MsgRenewAccount struct {
	Domain string
	Name   string
}

func (*MsgRenewAccount) GetSignBytes

func (m *MsgRenewAccount) GetSignBytes() []byte

func (*MsgRenewAccount) GetSigners

func (m *MsgRenewAccount) GetSigners() []sdk.AccAddress

func (*MsgRenewAccount) Route

func (m *MsgRenewAccount) Route() string

func (*MsgRenewAccount) Type

func (m *MsgRenewAccount) Type() string

func (*MsgRenewAccount) ValidateBasic

func (m *MsgRenewAccount) ValidateBasic() error

type MsgRenewDomain

type MsgRenewDomain struct {
	// Domain is the domain name to renew
	Domain string
}

func (*MsgRenewDomain) GetSignBytes

func (m *MsgRenewDomain) GetSignBytes() []byte

func (*MsgRenewDomain) GetSigners

func (m *MsgRenewDomain) GetSigners() []sdk.AccAddress

func (*MsgRenewDomain) Route

func (m *MsgRenewDomain) Route() string

func (*MsgRenewDomain) Type

func (m *MsgRenewDomain) Type() string

func (*MsgRenewDomain) ValidateBasic

func (m *MsgRenewDomain) ValidateBasic() error

type MsgReplaceAccountTargets

type MsgReplaceAccountTargets struct {
	Domain     string
	Name       string
	NewTargets []iovns.BlockchainAddress
	Owner      sdk.AccAddress
}

func (*MsgReplaceAccountTargets) GetSignBytes

func (m *MsgReplaceAccountTargets) GetSignBytes() []byte

func (*MsgReplaceAccountTargets) GetSigners

func (m *MsgReplaceAccountTargets) GetSigners() []sdk.AccAddress

func (*MsgReplaceAccountTargets) Route

func (m *MsgReplaceAccountTargets) Route() string

func (*MsgReplaceAccountTargets) Type

func (m *MsgReplaceAccountTargets) Type() string

func (*MsgReplaceAccountTargets) ValidateBasic

func (m *MsgReplaceAccountTargets) ValidateBasic() error

type MsgTransferAccount

type MsgTransferAccount struct {
	Domain   string
	Name     string
	Owner    sdk.AccAddress
	NewOwner sdk.AccAddress
}

MsgTransferAccount is the message used to transfer accounts

func (*MsgTransferAccount) GetSignBytes

func (m *MsgTransferAccount) GetSignBytes() []byte

GetSignBytes returns an ordered json of the request

func (*MsgTransferAccount) GetSigners

func (m *MsgTransferAccount) GetSigners() []sdk.AccAddress

GetSigners returns the list of address that should list the request in this case the admin of the domain

func (*MsgTransferAccount) Route

func (m *MsgTransferAccount) Route() string

Route returns the name of the module

func (*MsgTransferAccount) Type

func (m *MsgTransferAccount) Type() string

Type returns the action

func (*MsgTransferAccount) ValidateBasic

func (m *MsgTransferAccount) ValidateBasic() error

ValidateBasic does stateless checks on the request it checks if the domain name is valid

type MsgTransferDomain

type MsgTransferDomain struct {
	Domain   string
	Owner    sdk.AccAddress
	NewAdmin sdk.AccAddress
}

func (*MsgTransferDomain) GetSignBytes

func (m *MsgTransferDomain) GetSignBytes() []byte

func (*MsgTransferDomain) GetSigners

func (m *MsgTransferDomain) GetSigners() []sdk.AccAddress

func (*MsgTransferDomain) Route

func (m *MsgTransferDomain) Route() string

func (*MsgTransferDomain) Type

func (m *MsgTransferDomain) Type() string

func (*MsgTransferDomain) ValidateBasic

func (m *MsgTransferDomain) ValidateBasic() error

Jump to

Keyboard shortcuts

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