Additional auction module commands (#3)

Reviewed-on: deep-stack/laconic2d#3
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
2024-02-15 06:56:18 +00:00
committed by ashwin
parent cb1f723475
commit a36063aba6
16 changed files with 1010 additions and 37 deletions
+4 -3
View File
@@ -3,13 +3,14 @@ package module
import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
"git.vdb.to/cerc-io/laconic2d/x/auction/keeper"
)
// EndBlocker is called every block
func EndBlocker(ctx context.Context, k keeper.Keeper) error {
// TODO: Implement
// k.EndBlockerProcessAuctions(ctx)
sdkCtx := sdk.UnwrapSDKContext(ctx)
return nil
return k.EndBlockerProcessAuctions(sdkCtx)
}
+32
View File
@@ -43,6 +43,37 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
{ProtoField: "owner_address"},
},
},
{
RpcMethod: "GetBid",
Use: "get-bid [auction-id] [bidder]",
Short: "Get auction bid by auction id and bidder",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "auction_id"},
{ProtoField: "bidder"},
},
},
{
RpcMethod: "GetBids",
Use: "get-bids [auction-id]",
Short: "Get all auction bids",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "auction_id"},
},
},
{
RpcMethod: "AuctionsByBidder",
Use: "by-bidder [bidder]",
Short: "Get auctions list by bidder",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "bidder_address"},
},
},
{
RpcMethod: "GetAuctionModuleBalance",
Use: "balance",
Short: "Get auction module account balances",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
},
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
@@ -61,6 +92,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
},
},
EnhanceCustomCommand: true, // Allow additional manual commands
},
}
}
+7
View File
@@ -7,6 +7,7 @@ import (
"cosmossdk.io/core/appmodule"
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
@@ -15,6 +16,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
"git.vdb.to/cerc-io/laconic2d/x/auction"
"git.vdb.to/cerc-io/laconic2d/x/auction/client/cli"
"git.vdb.to/cerc-io/laconic2d/x/auction/keeper"
)
@@ -125,3 +127,8 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
func (am AppModule) EndBlock(ctx context.Context) error {
return EndBlocker(ctx, am.keeper)
}
// Get the root tx command of this module
func (AppModule) GetTxCmd() *cobra.Command {
return cli.GetTxCmd()
}