Skip to content

FIX: pass the coin type through the CLI will panic #4623

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

Open
Pantani opened this issue Apr 16, 2025 · 2 comments
Open

FIX: pass the coin type through the CLI will panic #4623

Pantani opened this issue Apr 16, 2025 · 2 comments

Comments

@Pantani
Copy link
Collaborator

Pantani commented Apr 16, 2025

Pass the coin type through the CLI will panic:

Eg:

  • Scaffold a chain with a coins type and run it:
ignite s chain venus && cd venus && \
ignite s list employee salary:coin && \
ignite chain serve
  • Try to create a new transaction:
venusd tx venus create-employee "2token"

result:

panic: proto: cosmos.base.v1beta1.Coin.denom: field descriptor does not belong to this message

goroutine 1 [running]:
google.golang.org/protobuf/types/dynamicpb.(*Message).checkField(0x14002859c00, {0x10627ff78, 0x14000597b08})
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/types/dynamicpb/dynamic.go:354 +0x238
google.golang.org/protobuf/types/dynamicpb.(*Message).Set(0x14002859c00, {0x10627ff78, 0x14000597b08}, {{}, 0x1059b4ee0?, 0x16dc4f7d4?, 0x102226848?})
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/types/dynamicpb/dynamic.go:247 +0x40
google.golang.org/protobuf/proto.mergeOptions.mergeMessage.func1({0x10627ff78, 0x14000597b08}, {{}, 0x1059b4ee0?, 0x16dc4f7d4?, 0x105bd3801?})
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/proto/merge.go:100 +0x268
cosmossdk.io/api/cosmos/base/v1beta1.(*fastReflection_Coin).Range(0x140021d2dc0, 0x1400181d6b0)
	/Users/danilopantani/Desktop/go/pkg/mod/cosmossdk.io/[email protected]/cosmos/base/v1beta1/coin.pulsar.go:98 +0x5c
google.golang.org/protobuf/proto.mergeOptions.mergeMessage({}, {0x106255b68, 0x14002859c00}, {0x10625a898, 0x140021d2dc0})
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/proto/merge.go:89 +0xd8
google.golang.org/protobuf/proto.mergeOptions.mergeMessage.func1({0x10627ff78, 0x1400260a110}, {{}, 0x106095b80?, 0x140021d2dc0?, 0x14000087118?})
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/proto/merge.go:96 +0x1e4
google.golang.org/protobuf/types/dynamicpb.(*Message).Range(0x14002859b00, 0x1400181d698)
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/types/dynamicpb/dynamic.go:147 +0x118
google.golang.org/protobuf/proto.mergeOptions.mergeMessage({}, {0x106255b68, 0x14002859bc0}, {0x106255b68, 0x14002859b00})
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/proto/merge.go:89 +0xd8
google.golang.org/protobuf/proto.Merge({0x1061db8c0?, 0x14002859bc0?}, {0x1061db8c0, 0x14002859b00})
	/Users/danilopantani/Desktop/go/pkg/mod/google.golang.org/[email protected]/proto/merge.go:36 +0xb4
cosmossdk.io/client/v2/autocli.(*Builder).BuildMsgMethodCommand.func1(0x14002861508, {0x106255b68, 0x14002859b00})
	/Users/danilopantani/Desktop/go/pkg/mod/cosmossdk.io/client/[email protected]/autocli/msg.go:152 +0x328
cosmossdk.io/client/v2/autocli.(*Builder).buildMethodCommandCommon.func1(0x14002861508, {0x14001e0b0e0, 0x1, 0x1?})
	/Users/danilopantani/Desktop/go/pkg/mod/cosmossdk.io/client/[email protected]/autocli/common.go:97 +0x200
github.com/spf13/cobra.(*Command).execute(0x14002861508, {0x14001e0b0b0, 0x1, 0x1})
	/Users/danilopantani/Desktop/go/pkg/mod/github.com/spf13/[email protected]/command.go:1015 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x14001462608)
	/Users/danilopantani/Desktop/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/danilopantani/Desktop/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/Users/danilopantani/Desktop/go/pkg/mod/github.com/spf13/[email protected]/command.go:1064
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x14001462608, {0x104ad4c6f, 0x5}, {0x14001170a20, 0x1b})
	/Users/danilopantani/Desktop/go/pkg/mod/github.com/cosmos/[email protected]/server/cmd/execute.go:34 +0x154
main.main()
	/Users/danilopantani/Desktop/go/src/github.com/ignite/venus/cmd/venusd/main.go:16 +0x44
@Pantani Pantani changed the title FIX: FIX: pass the coin type through the CLI will panic Apr 16, 2025
@Pantani
Copy link
Collaborator Author

Pantani commented May 3, 2025

In theory, we can fix passing the amount and the denom separated into the CLI command:

{
	RpcMethod:      "CreateEmployee",
	Use:            "create-employee [salary.amount] [salary.denom]",
	Short:          "Create employee",
	PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "salary.amount"}, {ProtoField: "salary.denom"}},
}

But the change has thrown an error when we start the chain:

✘ panic: can't find field salary.denom on venus.venus.v1.MsgCreateEmployee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Discuss
Development

No branches or pull requests

1 participant