Add commands to create and get auctions #2

Merged
ashwin merged 4 commits from pm-auction-commands into main 2024-02-12 08:34:41 +00:00
3 changed files with 19 additions and 2 deletions
Showing only changes of commit d445811e80 - Show all commits

View File

@ -173,3 +173,13 @@ func (k Keeper) CommitBid(ctx sdk.Context, msg auctiontypes.MsgCommitBid) (*auct
func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auctiontypes.Auction, error) { func (k Keeper) RevealBid(ctx sdk.Context, msg auctiontypes.MsgRevealBid) (*auctiontypes.Auction, error) {
panic("unimplemented") panic("unimplemented")
} }
// GetParams gets the auction module's parameters.
func (k Keeper) GetParams(ctx sdk.Context) (*auctiontypes.Params, error) {
params, err := k.Params.Get(ctx)
if err != nil {
return nil, err
}
return &params, nil
}

View File

@ -22,7 +22,14 @@ func NewQueryServerImpl(k Keeper) auctiontypes.QueryServer {
// Params implements the params query command // Params implements the params query command
func (qs queryServer) Params(c context.Context, req *auctiontypes.QueryParamsRequest) (*auctiontypes.QueryParamsResponse, error) { func (qs queryServer) Params(c context.Context, req *auctiontypes.QueryParamsRequest) (*auctiontypes.QueryParamsResponse, error) {
panic("unimplemented") ctx := sdk.UnwrapSDKContext(c)
params, err := qs.k.GetParams(ctx)
if err != nil {
return nil, err
}
return &auctiontypes.QueryParamsResponse{Params: params}, nil
} }
// Auctions queries all auctions // Auctions queries all auctions

View File

@ -18,7 +18,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
{ {
RpcMethod: "Params", RpcMethod: "Params",
Use: "params", Use: "params",
Short: "Get the current bond parameters", Short: "Get the current auction parameters",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{}, PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
}, },
{ {