types

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName defines the name of the module
	ModuleName = "configuration"
	// StoreKey is the key used to identify the module in the KVStore
	StoreKey = ModuleName
	// RouterKey is the key used to process transactions for the module
	RouterKey = ModuleName
	// QuerierRoute is used to process queries for the module
	QuerierRoute = ModuleName
	// DefaultParamSpace defines the key for the configuration paramspace
	DefaultParamSpace = ModuleName
)

ModuleConst

View Source
const (
	// ConfigKey defines the key used for the configuration
	// since the configuration is only one the key will always be one
	ConfigKey = "config"

	// FeeKey defines the key used for fees
	// since the fee params are only one
	// this is the only key we will need
	FeeKey = "fee"
)
View Source
const QueryConfig = "configuration"

QueryConfig is the route key used to query configuration data

View Source
const QueryFees = "fees"

QueryFees is the route key used to query fees data

Variables

View Source
var ModuleCdc *codec.Codec

ModuleCdc defines the module codec

Functions

func RegisterCodec added in v0.2.0

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on codec

Types

type Config

type Config struct {
	// Signer is the configuration owner, the addresses allowed to handle fees
	// and register domains with no superuser
	Configurer sdk.AccAddress `json:"configurer"`
	// ValidDomainName defines a regexp that determines if a domain name is valid or not
	ValidDomainName string `json:"valid_domain_name"`
	// ValidAccountName defines a regexp that determines if an account name is valid or not
	ValidAccountName string `json:"valid_account_name"`
	// ValidURI defines a regexp that determines if resource uri is valid or not
	ValidURI string `json:"valid_uri"`
	// ValidResource determines a regexp for a resource content
	ValidResource string `json:"valid_resource"`

	// DomainRenewalPeriod defines the duration of the domain renewal period in seconds
	DomainRenewalPeriod time.Duration `json:"domain_renew_period"`
	// DomainRenewalCountMax defines maximum number of domain renewals a user can do
	DomainRenewalCountMax uint32 `json:"domain_renew_count_max"`
	// DomainGracePeriod defines the grace period for a domain deletion in seconds
	DomainGracePeriod time.Duration `json:"domain_grace_period"`

	// AccountRenewalPeriod defines the duration of the account renewal period in seconds
	AccountRenewalPeriod time.Duration `json:"account_renew_period"`
	// AccountRenewalCountMax defines maximum number of account renewals a user can do
	AccountRenewalCountMax uint32 `json:"account_renew_count_max"`
	// DomainGracePeriod defines the grace period for a domain deletion in seconds
	AccountGracePeriod time.Duration `json:"account_grace_period"`
	// ResourcesMax defines maximum number of resources could be saved under an account
	ResourcesMax uint32 `json:"resources_max"`
	// CertificateSizeMax defines maximum size of a certificate that could be saved under an account
	CertificateSizeMax uint64 `json:"certificate_size_max"`
	// CertificateCountMax defines maximum number of certificates that could be saved under an account
	CertificateCountMax uint32 `json:"certificate_count_max"`
	// MetadataSizeMax defines maximum size of metadata that could be saved under an account
	MetadataSizeMax uint64 `json:"metadata_size_max"`
}

Config is the configuration of the network

func (Config) Validate added in v0.3.0

func (c Config) Validate() error

type Fees added in v0.2.0

type Fees struct {
	// FeeCoinDenom defines the denominator of the coin used to process fees
	FeeCoinDenom string  `json:"fee_coin_denom"`
	FeeCoinPrice sdk.Dec `json:"fee_coin_price"`
	// FeeDefault is the parameter defining the default fee
	FeeDefault sdk.Dec `json:"fee_default"`
	// account fees
	RegisterAccountClosed   sdk.Dec `json:"register_account_closed"`
	RegisterAccountOpen     sdk.Dec `json:"register_account_open"`
	TransferAccountClosed   sdk.Dec `json:"transfer_account_closed"`
	TransferAccountOpen     sdk.Dec `json:"transfer_account_open"`
	ReplaceAccountResources sdk.Dec `json:"replace_account_resources"`
	AddAccountCertificate   sdk.Dec `json:"add_account_certificate"`
	DelAccountCertificate   sdk.Dec `json:"del_account_certificate"`
	SetAccountMetadata      sdk.Dec `json:"set_account_metadata"`
	// domain fees
	// Register domain
	RegisterDomain1              sdk.Dec `json:"register_domain_1"`
	RegisterDomain2              sdk.Dec `json:"register_domain_2"`
	RegisterDomain3              sdk.Dec `json:"register_domain_3"`
	RegisterDomain4              sdk.Dec `json:"register_domain_4"`
	RegisterDomain5              sdk.Dec `json:"register_domain_5"`
	RegisterDomainDefault        sdk.Dec `json:"register_domain_default"`
	RegisterOpenDomainMultiplier sdk.Dec `json:"register_open_domain_multiplier"`
	// TransferDomain
	TransferDomainClosed sdk.Dec `json:"transfer_domain_closed"`
	TransferDomainOpen   sdk.Dec `json:"transfer_domain_open"`
	// RenewDomain
	RenewDomainOpen sdk.Dec `json:"renew_domain_open"`
}

Fees contains different type of fees to calculate coins to detract when processing different messages

func NewFees added in v0.2.0

func NewFees() *Fees

func (*Fees) SetDefaults added in v0.4.0

func (f *Fees) SetDefaults(denom string)

SetDefaults sets the default fees, it takes only one parameter which is the coin name that will be used by the users who want to access the domain module functionalities

func (*Fees) Validate added in v0.4.0

func (f *Fees) Validate() error

type MsgUpdateConfig added in v0.2.0

type MsgUpdateConfig struct {
	Signer           sdk.AccAddress
	NewConfiguration Config
}

MsgUpdateConfig is used to update configuration using a multisig strategy

func (MsgUpdateConfig) GetSignBytes added in v0.2.0

func (m MsgUpdateConfig) GetSignBytes() []byte

GetSignBytes implements sdk.Msg

func (MsgUpdateConfig) GetSigners added in v0.2.0

func (m MsgUpdateConfig) GetSigners() []sdk.AccAddress

GetSigners implements sdk.Msg

func (MsgUpdateConfig) Route added in v0.2.0

func (m MsgUpdateConfig) Route() string

func (MsgUpdateConfig) Type added in v0.2.0

func (m MsgUpdateConfig) Type() string

func (MsgUpdateConfig) ValidateBasic added in v0.2.0

func (m MsgUpdateConfig) ValidateBasic() error

type MsgUpdateFees added in v0.4.0

type MsgUpdateFees struct {
	Fees       *Fees
	Configurer sdk.AccAddress
}

func (MsgUpdateFees) GetSignBytes added in v0.4.0

func (m MsgUpdateFees) GetSignBytes() []byte

func (MsgUpdateFees) GetSigners added in v0.4.0

func (m MsgUpdateFees) GetSigners() []sdk.AccAddress

func (MsgUpdateFees) Route added in v0.4.0

func (m MsgUpdateFees) Route() string

func (MsgUpdateFees) Type added in v0.4.0

func (m MsgUpdateFees) Type() string

func (MsgUpdateFees) ValidateBasic added in v0.4.0

func (m MsgUpdateFees) ValidateBasic() error

type QueryConfigResponse

type QueryConfigResponse struct {
	Configuration Config `json:"configuration"`
}

QueryConfigResponse is the result returned after a query to the chain configuration

type QueryFeesResponse added in v0.2.0

type QueryFeesResponse struct {
	Fees *Fees `json:"fees"`
}

Jump to

Keyboard shortcuts

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