Add commands to create and get auctions #2
@ -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) {
|
||||
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 ¶ms, nil
|
||||
}
|
||||
|
@ -22,7 +22,14 @@ func NewQueryServerImpl(k Keeper) auctiontypes.QueryServer {
|
||||
|
||||
// Params implements the params query command
|
||||
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
|
||||
|
@ -18,7 +18,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
||||
{
|
||||
RpcMethod: "Params",
|
||||
Use: "params",
|
||||
Short: "Get the current bond parameters",
|
||||
Short: "Get the current auction parameters",
|
||||
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user