Documentation ¶
Overview ¶
Package configuration contains the iovns module for handling state configuration such as account
Index ¶
- Constants
- Variables
- func AvailableQueries() []queries.QueryHandler
- func DefaultGenesisState() types.GenesisState
- func ExportGenesis(ctx sdk.Context, k Keeper) *types.GenesisState
- func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState)
- func NewGenesisState(conf types.Config, fees *types.Fees) types.GenesisState
- func NewHandler(k Keeper) sdk.Handler
- func NewLegacyQuerier(keeper *Keeper) sdk.Querier
- func NewQuerier(keeper *Keeper) grpcQuerier
- func NewTestCodec() *codec.AminoCodec
- func RunTests(t *testing.T, tests map[string]SubTest)
- func ValidateGenesis(data types.GenesisState) error
- type AppModule
- func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
- func (AppModule) ConsensusVersion() uint64
- func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (a AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage
- func (a AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate
- func (a AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier
- func (AppModule) Name() string
- func (AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (a AppModule) RegisterServices(configurator module.Configurator)
- func (a AppModule) Route() sdk.Route
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
- func (b AppModuleBasic) GetQueryCmd() *cobra.Command
- func (b AppModuleBasic) GetTxCmd() *cobra.Command
- func (AppModuleBasic) Name() string
- func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, serveMux *runtime.ServeMux)
- func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino)
- func (AppModuleBasic) RegisterRESTRoutes(cliCtx client.Context, rtr *mux.Router)
- func (b AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, ...) error
- type Config
- type Fees
- type Keeper
- func (k Keeper) GetConfiguration(ctx sdk.Context) types.Config
- func (k Keeper) GetConfigurer(ctx sdk.Context) string
- 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 Migrator
- 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 = "^(.*?)?"
RegexMatchAll matches everything.
const RegexMatchNothing = "$^"
RegexMatchNothing matches nothing.
Variables ¶
var ( // NewFees aliases types.NewFees NewFees = types.NewFees // RegisterCodec aliases types.RegisterLegacyAminoCodec RegisterCodec = types.RegisterLegacyAminoCodec )
var AliceKey types.AccAddress = addrs[0]
AliceKey is poorly named since it's Alice's address. TODO FIXME
var BobKey types.AccAddress = addrs[1]
BobKey is poorly named since it's Bob's address. TODO FIXME
var CharlieKey types.AccAddress = addrs[2]
CharlieKey is poorly named since it's Charlie's address. TODO FIXME
Functions ¶
func AvailableQueries ¶
func AvailableQueries() []queries.QueryHandler
AvailableQueries returns the list of available queries in the module
func DefaultGenesisState ¶
func DefaultGenesisState() types.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) *types.GenesisState
ExportGenesis saves the state of the configuration module
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data types.GenesisState)
InitGenesis sets the initial state of the configuration module
func NewGenesisState ¶
NewGenesisState is GenesisState constructor
func NewHandler ¶
NewHandler returns the handlers for the configuration module
func NewLegacyQuerier ¶
NewLegacyQuerier builds the query handler for the module
func NewQuerier ¶
func NewQuerier(keeper *Keeper) grpcQuerier
NewQuerier provides a gRPC querier TODO: this needs proper tests and doc
func NewTestCodec ¶
func NewTestCodec() *codec.AminoCodec
NewTestCodec generates a mock codec for keeper module
func RunTests ¶
RunTests run tests cases after generating a new keeper and context for each test case
func ValidateGenesis ¶
func ValidateGenesis(data types.GenesisState) error
ValidateGenesis makes sure that the genesis state is valid
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the configuration module.
func NewAppModule ¶
NewAppModule creates a new AppModule object.
func (AppModule) BeginBlock ¶
func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)
BeginBlock returns the begin blocker for the configuration module.
func (AppModule) ConsensusVersion ¶ added in v0.11.4
ConsensusVersion implements AppModule/ConsensusVersion.
func (AppModule) EndBlock ¶
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the configuration module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
ExportGenesis returns the exported genesis state as raw bytes for the configuration module.
func (AppModule) InitGenesis ¶
func (a AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the configuration module. It returns no validator updates.
func (AppModule) LegacyQuerierHandler ¶
func (a AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier
LegacyQuerierHandler provides an sdk.Querier object that uses the legacy amino codec.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the configuration module's querier route name.
func (AppModule) RegisterInvariants ¶
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
RegisterInvariants registers the configuration module invariants.
func (AppModule) RegisterServices ¶
func (a AppModule) RegisterServices(configurator module.Configurator)
RegisterServices allows a module to register services
type AppModuleBasic ¶
type AppModuleBasic struct {
// contains filtered or unexported fields
}
AppModuleBasic defines the basic application module used by the configuration module.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the configuration module.
func (AppModuleBasic) GetQueryCmd ¶
func (b AppModuleBasic) GetQueryCmd() *cobra.Command
GetQueryCmd returns no root query command for the configuration module.
func (AppModuleBasic) GetTxCmd ¶
func (b AppModuleBasic) GetTxCmd() *cobra.Command
GetTxCmd returns the root tx command for the configuration module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the configuration module's name.
func (AppModuleBasic) RegisterGRPCGatewayRoutes ¶
func (b AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, serveMux *runtime.ServeMux)
RegisterGRPCGatewayRoutes registers the query handler client.
func (AppModuleBasic) RegisterInterfaces ¶
func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)
RegisterInterfaces implements InterfaceModule
func (AppModuleBasic) RegisterLegacyAminoCodec ¶
func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the amino codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(cliCtx client.Context, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the configuration module.
func (AppModuleBasic) ValidateGenesis ¶
func (b AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error
ValidateGenesis performs genesis state validation for the configuration module.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper is the key value store handler for the configuration module
func NewTestKeeper ¶
NewTestKeeper generates a keeper and a context from it
func (Keeper) GetConfiguration ¶
GetConfiguration returns the configuration of the blockchain
func (Keeper) GetConfigurer ¶
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 ¶
GetValidDomainNameRegexp returns the regular expression used to match valid domain names
type Migrator ¶ added in v0.11.4
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶ added in v0.11.4
NewMigrator returns a new Migrator.
type QueryConfiguration ¶
type QueryConfiguration struct{}
QueryConfiguration is the request model used to get the configuration
func (*QueryConfiguration) Description ¶
func (q *QueryConfiguration) Description() string
Description is a placeholder
func (*QueryConfiguration) Handler ¶
func (q *QueryConfiguration) Handler() QueryHandlerFunc
Handler implements QueryHandler
func (*QueryConfiguration) QueryPath ¶
func (q *QueryConfiguration) QueryPath() string
QueryPath implements QueryHandler
func (*QueryConfiguration) Validate ¶
func (q *QueryConfiguration) Validate() error
Validate implements QueryHandler
type QueryConfigurationResponse ¶
type QueryConfigurationResponse struct { // Config represents the current configurations Config Config `json:"configuration"` }
QueryConfigurationResponse is the response returned after querying the configuration
type QueryFees ¶
type QueryFees struct{}
QueryFees is the request model used to get the current fees
func (*QueryFees) Description ¶
Description is a placeholder
func (*QueryFees) Handler ¶
func (q *QueryFees) Handler() QueryHandlerFunc
Handler implements QueryHandler
type QueryFeesResponse ¶
type QueryFeesResponse struct { // Fees represents the current fees of the network Fees Fees `json:"fees"` }
QueryFeesResponse is returned after querying fees
type QueryHandlerFunc ¶
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 ¶
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 |
migrations
|
|
Package types contains all the types used by the configuration module
|
Package types contains all the types used by the configuration module |