Skip to content

Commit

Permalink
merge: bump onft & marketplace version, alloc module parms cli query (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 authored Feb 16, 2022
2 parents 5b4a193 + 286c0ff commit 43e65a6
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 23 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/OmniFlix/omniflixhub
go 1.17

require (
github.com/OmniFlix/marketplace v0.2.0-alpha.2
github.com/OmniFlix/onft v0.3.0-alpha.1
github.com/OmniFlix/marketplace v0.2.0
github.com/OmniFlix/onft v0.3.0
github.com/cosmos/cosmos-sdk v0.45.1
github.com/cosmos/ibc-go/v2 v2.0.3
github.com/gogo/protobuf v1.3.3
Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXG
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OmniFlix/marketplace v0.2.0-alpha.2 h1:xh3AWWUqmh2zAW6DndwUC4hZMdF08xjyd6YPO+6zRtU=
github.com/OmniFlix/marketplace v0.2.0-alpha.2/go.mod h1:z/u3ndafrxT1k6O2dxoogD2C1gjrnS+t5wet7316ruA=
github.com/OmniFlix/onft v0.3.0-alpha.1 h1:r52CUJOohS7FMhGwF8eZXd9evm2O8+1DIoobmbhq6gg=
github.com/OmniFlix/marketplace v0.2.0 h1:VvPk9MkM3OUUbikR8jDLMdfdgKcXunlY+OXJkPH0ZII=
github.com/OmniFlix/marketplace v0.2.0/go.mod h1:z/u3ndafrxT1k6O2dxoogD2C1gjrnS+t5wet7316ruA=
github.com/OmniFlix/onft v0.3.0-alpha.1/go.mod h1:y1RknOuWIm2FhShS8Cb03mgyryYu7xZa+PzG5lN3O3A=
github.com/OmniFlix/onft v0.3.0 h1:VDMFJuBEI+OyvcPCBXph+sS6OY7i1uQ9H0I0ZpleU8Q=
github.com/OmniFlix/onft v0.3.0/go.mod h1:y1RknOuWIm2FhShS8Cb03mgyryYu7xZa+PzG5lN3O3A=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM=
Expand Down
31 changes: 30 additions & 1 deletion x/alloc/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"fmt"
"github.com/cosmos/cosmos-sdk/client/flags"

"github.com/OmniFlix/omniflixhub/x/alloc/types"
"github.com/cosmos/cosmos-sdk/client"
Expand All @@ -18,8 +19,36 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}

cmd.AddCommand(
GetCmdQueryParams(),
)
// this line is used by starport scaffolding # 1

return cmd
}

// GetCmdQueryParams implements the query params command.
func GetCmdQueryParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Args: cobra.NoArgs,
Short: "Query alloc params",
RunE: func(cmd *cobra.Command, _ []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
if err != nil {
return err
}

return clientCtx.PrintProto(&res.Params)
},
}

flags.AddQueryFlagsToCmd(cmd)
return cmd
}
2 changes: 1 addition & 1 deletion x/alloc/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName))
}

// GetModuleAccountBalance gets the airdrop coin balance of module account
// GetModuleAccountBalance gets the coin balance of module account
func (k Keeper) GetModuleAccountAddress(ctx sdk.Context) sdk.AccAddress {
return k.accountKeeper.GetModuleAddress(types.ModuleName)
}
Expand Down
32 changes: 16 additions & 16 deletions x/alloc/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var (
// AppModuleBasic
// ----------------------------------------------------------------------------

// AppModuleBasic implements the AppModuleBasic interface for the capability module.
// AppModuleBasic implements the AppModuleBasic interface for the alloc module.
type AppModuleBasic struct {
cdc codec.BinaryCodec
}
Expand All @@ -41,7 +41,7 @@ func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic {
return AppModuleBasic{cdc: cdc}
}

// Name returns the capability module's name.
// Name returns the alloc module's name.
func (AppModuleBasic) Name() string {
return types.ModuleName
}
Expand All @@ -59,12 +59,12 @@ func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) {
types.RegisterInterfaces(reg)
}

// DefaultGenesis returns the capability module's default genesis state.
// DefaultGenesis returns the alloc module's default genesis state.
func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
return cdc.MustMarshalJSON(types.DefaultGenesis())
}

// ValidateGenesis performs genesis state validation for the capability module.
// ValidateGenesis performs genesis state validation for the alloc module.
func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error {
var genState types.GenesisState
if err := cdc.UnmarshalJSON(bz, &genState); err != nil {
Expand All @@ -73,7 +73,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod
return genState.Validate()
}

// RegisterRESTRoutes registers the capability module's REST service handlers.
// RegisterRESTRoutes registers the alloc module's REST service handlers.
func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {
}

Expand All @@ -90,7 +90,7 @@ func (a AppModuleBasic) GetTxCmd() *cobra.Command {
return cli.GetTxCmd()
}

// GetQueryCmd returns the capability module's root query command.
// GetQueryCmd returns the alloc module's root query command.
func (AppModuleBasic) GetQueryCmd() *cobra.Command {
return cli.GetQueryCmd(types.StoreKey)
}
Expand All @@ -99,7 +99,7 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command {
// AppModule
// ----------------------------------------------------------------------------

// AppModule implements the AppModule interface for the capability module.
// AppModule implements the AppModule interface for the alloc module.
type AppModule struct {
AppModuleBasic

Expand All @@ -113,20 +113,20 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule {
}
}

// Name returns the capability module's name.
// Name returns the alloc module's name.
func (am AppModule) Name() string {
return am.AppModuleBasic.Name()
}

// Route returns the capability module's message routing key.
// Route returns the alloc module's message routing key.
func (am AppModule) Route() sdk.Route {
return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper))
}

// QuerierRoute returns the capability module's query routing key.
// QuerierRoute returns the alloc module's query routing key.
func (AppModule) QuerierRoute() string { return types.QuerierRoute }

// LegacyQuerierHandler returns the capability module's Querier.
// LegacyQuerierHandler returns the alloc module's Querier.
func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
return nil
}
Expand All @@ -137,10 +137,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}

// RegisterInvariants registers the capability module's invariants.
// RegisterInvariants registers the alloc module's invariants.
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// InitGenesis performs the capability module's genesis initialization It returns
// InitGenesis performs the alloc module's genesis initialization It returns
// no validator updates.
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate {
var genState types.GenesisState
Expand All @@ -152,7 +152,7 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.Ra
return []abci.ValidatorUpdate{}
}

// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes.
// ExportGenesis returns the alloc module's exported genesis state as raw JSON bytes.
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {
genState := ExportGenesis(ctx, am.keeper)
return cdc.MustMarshalJSON(genState)
Expand All @@ -161,12 +161,12 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
// ConsensusVersion implements ConsensusVersion.
func (AppModule) ConsensusVersion() uint64 { return 2 }

// BeginBlock executes all ABCI BeginBlock logic respective to the capability module.
// BeginBlock executes all ABCI BeginBlock logic respective to the alloc module.
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
BeginBlocker(ctx, am.keeper)
}

// EndBlock executes all ABCI EndBlock logic respective to the capability module. It
// EndBlock executes all ABCI EndBlock logic respective to the alloc module. It
// returns no validator updates.
func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return []abci.ValidatorUpdate{}
Expand Down

0 comments on commit 43e65a6

Please sign in to comment.