Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(x/nft): add autocli options for tx #17825

Merged
merged 10 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions x/nft/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ Ref: https://keepachangelog.com/en/1.0.0/
-->

# Changelog

## [Unreleased]

### Features

* [#17825](https://github.com/cosmos/cosmos-sdk/pull/17825) Add AutoCLI Options.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [#17825](https://github.com/cosmos/cosmos-sdk/pull/17825) Add AutoCLI Options.
*(x/nft) [#17825](https://github.com/cosmos/cosmos-sdk/pull/17825) Add AutoCLI Options.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary as it's in the nft changelog

66 changes: 0 additions & 66 deletions x/nft/client/cli/tx.go

This file was deleted.

242 changes: 0 additions & 242 deletions x/nft/client/cli/tx_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion x/nft/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require (
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.4
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb
google.golang.org/grpc v1.58.2
Expand Down Expand Up @@ -123,6 +122,7 @@ require (
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.16.0 // indirect
Expand Down
13 changes: 13 additions & 0 deletions x/nft/module/autocli.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: nftv1beta1.Msg_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "Send",
Use: "send [class-id] [nft-id] [receiver] --from [sender]",
Short: "Transfer ownership of NFT",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "class_id"},
{ProtoField: "id"},
{ProtoField: "receiver"},
},
// Sender is the signer of the transaction and is automatically added as from flag by AutoCLI.
},
},
},
}
}
7 changes: 0 additions & 7 deletions x/nft/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"

gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
"google.golang.org/grpc"

modulev1 "cosmossdk.io/api/cosmos/nft/module/v1"
Expand All @@ -15,7 +14,6 @@ import (
"cosmossdk.io/depinject"
"cosmossdk.io/errors"
"cosmossdk.io/x/nft"
"cosmossdk.io/x/nft/client/cli"
"cosmossdk.io/x/nft/keeper"
"cosmossdk.io/x/nft/simulation"

Expand Down Expand Up @@ -85,11 +83,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux
}
}

// GetTxCmd returns the transaction commands for the nft module
func (AppModuleBasic) GetTxCmd() *cobra.Command {
return cli.GetTxCmd()
}

// AppModule implements the sdk.AppModule interface
type AppModule struct {
AppModuleBasic
Expand Down
Loading