Documentation ¶
Overview ¶
Package configuration contains the iovns module for handling state configuration such as account
Index ¶
- Constants
- Variables
- func AvailableQueries() []queries.QueryHandler
- func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
- func NewHandler(k Keeper) sdk.Handler
- func NewQuerier(k Keeper) sdk.Querier
- func NewTestCodec() *codec.Codec
- func RunTests(t *testing.T, tests map[string]SubTest)
- func ValidateGenesis(data GenesisState) error
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (a AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (a AppModule) NewHandler() sdk.Handler
- func (a AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, router *mux.Router)
- func (AppModuleBasic) ValidateGenesis(b json.RawMessage) (err error)
- type Config
- type Fees
- type GenesisState
- type Keeper
- func (k Keeper) GetConfiguration(ctx sdk.Context) types.Config
- func (k Keeper) GetConfigurer(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetDomainGracePeriod(ctx sdk.Context) time.Duration
- func (k Keeper) GetDomainRenewDuration(ctx sdk.Context) time.Duration
- func (k Keeper) GetFees(ctx sdk.Context) *types.Fees
- func (k Keeper) GetValidDomainNameRegexp(ctx sdk.Context) string
- func (k Keeper) IsOwner(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetConfig(ctx sdk.Context, conf types.Config)
- func (k Keeper) SetFees(ctx sdk.Context, fees *types.Fees)
- type ParamSubspace
- type QueryConfiguration
- type QueryConfigurationResponse
- type QueryFees
- type QueryFeesResponse
- type QueryHandlerFunc
- type SubTest
Constants ¶
const ( ModuleName = types.ModuleName // ModuleName aliases types.ModuleName RouterKey = types.RouterKey // RouterKey aliases types.RouterKey QuerierRoute = types.QuerierRoute // QuerierRoute aliases types.QuerierRoute QueryConfig = types.QueryConfig // QueryConfig aliases types.QueryConfig StoreKey = types.StoreKey // StoreKey aliases types.StoreKey DefaultParamSpace = types.DefaultParamSpace )
alias for consts
const RegexMatchAll = "^(.*?)?"
const RegexMatchNothing = "$^"
Variables ¶
var ( // NewFees aliases types.NewFees NewFees = types.NewFees // RegisterCodec aliases types.RegisterCodec RegisterCodec = types.RegisterCodec )
var AliceKey types.AccAddress = addrs[0]
var BobKey types.AccAddress = addrs[1]
var CharlieKey types.AccAddress = addrs[2]
Functions ¶
func AvailableQueries ¶ added in v0.4.3
func AvailableQueries() []queries.QueryHandler
AvailableQueries returns the list of available queries in the module
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
InitGenesis sets the initial state of the configuration module
func NewHandler ¶
NewHandler returns the handlers for the configuration module
func NewQuerier ¶
NewQuerier builds the query handler for the module
func NewTestCodec ¶ added in v0.4.5
NewTestCodec generates aliceAddr mock codec for keeper module
func RunTests ¶ added in v0.4.5
runTests run tests cases after generating a new keeper and context for each test case
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis makes sure that the genesis state is valid
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
- - FILL APP MODULE - -
func NewAppModule ¶
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
func (AppModule) ExportGenesis ¶
func (a AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
func (AppModule) InitGenesis ¶
func (a AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
func (AppModule) NewHandler ¶
func (AppModule) NewQuerierHandler ¶
func (AppModule) QuerierRoute ¶
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
type AppModuleBasic ¶
type AppModuleBasic struct{}
nolint - - - FILL APP MODULE BASIC -- // AppModuleBasic implements the AppModuleBasic interface of the cosmos-sdk
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, router *mux.Router)
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(b json.RawMessage) (err error)
type GenesisState ¶
type GenesisState struct { // Config contains the configuration Config types.Config `json:"config"` // Fees contains the fees Fees *types.Fees `json:"fees"` }
GenesisState is used to unmarshal the genesis state when the app is initialized, and it is used to marshal the state when it needs to be exported.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns the default genesis state TODO this needs to be updated, although it will be imported from iovns chain
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis saves the state of the configuration module
func NewGenesisState ¶
func NewGenesisState(conf types.Config, fees *types.Fees) GenesisState
NewGenesisState is GenesisState constructor
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper is the key value store handler for the configuration module
func NewTestKeeper ¶ added in v0.4.5
NewTestKeeper generates aliceAddr keeper and aliceAddr context from it
func (Keeper) GetConfiguration ¶
GetConfiguration returns the configuration of the blockchain
func (Keeper) GetConfigurer ¶ added in v0.2.4
func (k Keeper) GetConfigurer(ctx sdk.Context) sdk.AccAddress
GetConfigurer returns the owner of domains with no superuser
func (Keeper) GetDomainGracePeriod ¶
GetDomainGracePeriod returns the default grace period before domains can be deleted by someone other than the owner him/herself
func (Keeper) GetDomainRenewDuration ¶
GetDomainRenewDuration returns the duration of a domain renewal period
func (Keeper) GetValidDomainNameRegexp ¶ added in v0.3.0
GetValidDomainNameRegexp returns the regular expression used to match valid domain names
type ParamSubspace ¶ added in v0.4.5
type ParamSubspace interface { }
ParamSubspace is a placeholder
type QueryConfiguration ¶ added in v0.4.3
type QueryConfiguration struct{}
QueryConfiguration is the request model used to get the configuration
func (*QueryConfiguration) Description ¶ added in v0.4.3
func (q *QueryConfiguration) Description() string
Description is a placeholder
func (*QueryConfiguration) Handler ¶ added in v0.4.3
func (q *QueryConfiguration) Handler() QueryHandlerFunc
Handler implements QueryHandler
func (*QueryConfiguration) QueryPath ¶ added in v0.4.3
func (q *QueryConfiguration) QueryPath() string
QueryPath implements QueryHandler
func (*QueryConfiguration) Use ¶ added in v0.4.3
func (q *QueryConfiguration) Use() string
Use is a placeholder
func (*QueryConfiguration) Validate ¶ added in v0.4.3
func (q *QueryConfiguration) Validate() error
Validate implements QueryHandler
type QueryConfigurationResponse ¶ added in v0.4.3
type QueryConfigurationResponse struct { // Config represents the current configurations Config Config `json:"configuration"` }
QueryConfigurationResponse is the response returned after querying the configuration
type QueryFees ¶ added in v0.4.3
type QueryFees struct{}
QueryFees is the request model used to get the current fees
func (*QueryFees) Description ¶ added in v0.4.3
Description is a placeholder
func (*QueryFees) Handler ¶ added in v0.4.3
func (q *QueryFees) Handler() QueryHandlerFunc
Handler implements QueryHandler
type QueryFeesResponse ¶ added in v0.4.3
type QueryFeesResponse struct { // Fees represents the current fees of the network Fees Fees `json:"fees"` }
QueryFeesResponse is returned after querying fees
type QueryHandlerFunc ¶ added in v0.4.3
type QueryHandlerFunc func(ctx sdk.Context, path []string, query abci.RequestQuery, k Keeper) ([]byte, error)
QueryHandlerFunc defines the query handler for this module
type SubTest ¶ added in v0.4.5
type SubTest struct { // BeforeTestBlockTime is the block time during before test in unix seconds // WARNING: if block time is given 0, it will be accepted as time.Now() BeforeTestBlockTime int64 // BeforeTest is the function run before doing the test, // used for example to store state, like configurations etc. // Ignored if nil BeforeTest func(t *testing.T, k Keeper, ctx types.Context) // TestBlockTime is the block time during test in unix seconds // WARNING: if block time is given 0, it will be accepted as time.Now() TestBlockTime int64 // Test is the function that runs the actual test Test func(t *testing.T, k Keeper, ctx types.Context) // AfterTestBlockTime is the block time during after test in unix seconds // WARNING: if block time is given 0, it will be accepted as time.Now() AfterTestBlockTime int64 // AfterTest performs actions after the test is run, it can // be used to check if the state after Test is run matches // the result we expect. // Ignored if nil AfterTest func(t *testing.T, k Keeper, ctx types.Context) }
subTest defines a test runner
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
client
|
|
cli
Package cli contains the cobra commands used to interact with the configuration module via CLI
|
Package cli contains the cobra commands used to interact with the configuration module via CLI |
rest
Package rest contains the handlers used to interact with the configuration module via REST
|
Package rest contains the handlers used to interact with the configuration module via REST |
Package types contains all the types used by the configuration module
|
Package types contains all the types used by the configuration module |