types

package
v0.9.8 Latest Latest
Warning

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

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

Documentation

Overview

Package types contains all the types used by the configuration module

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 defines the price of the coin
	FeeCoinPrice sdk.Dec `json:"fee_coin_price"`
	// FeeDefault is the parameter defining the default fee
	FeeDefault sdk.Dec `json:"fee_default"`
	// account fees
	// RegisterAccountClosed is the fee to be paid to register an account in a closed domain
	RegisterAccountClosed sdk.Dec `json:"register_account_closed"`
	// RegisterAccountOpen is the fee to be paid to register an account in an open domain
	RegisterAccountOpen sdk.Dec `json:"register_account_open"`
	// TransferAccountClosed is the fee to be paid to register an account in a closed domain
	TransferAccountClosed sdk.Dec `json:"transfer_account_closed"`
	// TransferAccountOpen is the fee to be paid to register an account in an open domain
	TransferAccountOpen sdk.Dec `json:"transfer_account_open"`
	// ReplaceAccountResources is the fee to be paid to replace account's resources
	ReplaceAccountResources sdk.Dec `json:"replace_account_resources"`
	// AddAccountCertificate is the fee to be paid to add a certificate to an account
	AddAccountCertificate sdk.Dec `json:"add_account_certificate"`
	// DelAccountCertificate is the feed to be paid to delete a certificate in an account
	DelAccountCertificate sdk.Dec `json:"del_account_certificate"`
	// SetAccountMetadata is the fee to be paid to set account's metadata
	SetAccountMetadata sdk.Dec `json:"set_account_metadata"`
	// domain fees
	// Register domain
	// RegisterDomain1 is the fee to be paid to register a domain with one character
	RegisterDomain1 sdk.Dec `json:"register_domain_1"`
	// RegisterDomain2 is the fee to be paid to register a domain with two characters
	RegisterDomain2 sdk.Dec `json:"register_domain_2"`
	// RegisterDomain3 is the fee to be paid to register a domain with three characters
	RegisterDomain3 sdk.Dec `json:"register_domain_3"`
	// RegisterDomain4 is the fee to be paid to register a domain with four characters
	RegisterDomain4 sdk.Dec `json:"register_domain_4"`
	// RegisterDomain5 is the fee to be paid to register a domain with five characters
	RegisterDomain5 sdk.Dec `json:"register_domain_5"`
	// RegisterDomainDefault is the fee to be paid to register a domain with more than five characters
	RegisterDomainDefault sdk.Dec `json:"register_domain_default"`
	// RegisterDomainMultiplier is the multiplication applied to fees in register domain operations if they're of open type
	RegisterOpenDomainMultiplier sdk.Dec `json:"register_open_domain_multiplier"`
	// TransferDomain
	// TransferDomainClosed is the fee to be paid to transfer a closed domain
	TransferDomainClosed sdk.Dec `json:"transfer_domain_closed"`
	// TransferDomainOpen is the fee to be paid to transfer open domains
	TransferDomainOpen sdk.Dec `json:"transfer_domain_open"`
	// RenewDomainOpen is the fee to be paid to renew an open domain
	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

Validate validates the fee object

type MsgUpdateConfig added in v0.2.0

type MsgUpdateConfig struct {
	// Signer is the address of the entity who is doing the transaction
	Signer sdk.AccAddress
	// NewConfiguration contains the new configuration data
	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

Route implements sdk.Msg

func (MsgUpdateConfig) Type added in v0.2.0

func (m MsgUpdateConfig) Type() string

Type implements sdk.Msg

func (MsgUpdateConfig) ValidateBasic added in v0.2.0

func (m MsgUpdateConfig) ValidateBasic() error

ValidateBasic implements sdk.Msg

type MsgUpdateFees added in v0.4.0

type MsgUpdateFees struct {
	// Fees represent the new fees to apply
	Fees *Fees
	// Configurer is the address that is singing the message
	Configurer sdk.AccAddress
}

func (MsgUpdateFees) GetSignBytes added in v0.4.0

func (m MsgUpdateFees) GetSignBytes() []byte

GetSignBytes implements sdk.Msg

func (MsgUpdateFees) GetSigners added in v0.4.0

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

GetSigners implements sdk.Msg

func (MsgUpdateFees) Route added in v0.4.0

func (m MsgUpdateFees) Route() string

Route implements sdk.Msg

func (MsgUpdateFees) Type added in v0.4.0

func (m MsgUpdateFees) Type() string

Type implements sdk.Msg

func (MsgUpdateFees) ValidateBasic added in v0.4.0

func (m MsgUpdateFees) ValidateBasic() error

ValidateBasic implements sdk.Msg

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"`
}

QueryFeesResponse is the result returned after a query to the product fees

Jump to

Keyboard shortcuts

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