cli icon indicating copy to clipboard operation
cli copied to clipboard

INIT: Scaffolding an array of custom type

Open ashishchandr70 opened this issue 3 years ago • 5 comments

Is your feature request related to a problem or issue you encountered? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I am playing around with the ignite cli and am trying to scaffold a new type which has one of its fields as an array of a previously defined custom type. However, I get this error:

invalid proto message name array.Foo

These are my steps: ignite s chain mychain ignite s type foo index:int location So far so good. Type foo is successfully created. Now, I want to do this: ignite s type bar items:array.Foo

This is when I get this error: invalid proto message name array.Foo

I am doing this in emulation of the scaffolding of other array types, such as string as per https://docs.ignite.com/kb/types

Describe the solution you'd like A clear and concise description of what you want to happen.

I would like this scaffolding to work, just like it would work for

ignite s type bar items:array.string

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

I could add the repeated prefix in the protobuf file but then I am not exactly sure how many other files would require an update. However, I have not tried this approach but I can, if this feature is not supported.

Include other useful information that helps us understand your request.

My ignite cli info:

Ignite CLI version:     v0.25.1
Ignite CLI build date:  2022-10-20T15:52:00Z
Ignite CLI source hash: cc393a9b59a8792b256432fafb472e5ac0738f7c
Cosmos SDK version:     v0.46.3
Your OS:                linux
Your arch:              amd64
Your Node.js version:   v12.22.9
Your go version:        go version go1.18.1 linux/amd64
Your uname -a:          Linux ubuntu2-virtual-machine 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Your cwd:               /home/ubuntu/mychain
Is on Gitpod:           false

ashishchandr70 avatar Nov 10 '22 16:11 ashishchandr70

This would be a useful feature for sure. We do not support this currently, but will be adding this as a feature to include in our planned scaffolding improvements epic.

As you've said, in the meantime the best option is to modify the protobuf files manually, then recompile them using ignite c build.

If you have any issues with this process feel free to provide more info here in this issue and we can try to help!

aljo242 avatar Nov 14 '22 14:11 aljo242

Thanks. I took that approach and it works!

ashishchandr70 avatar Nov 14 '22 15:11 ashishchandr70

Reopening this. I think this is a very useful feature to have.

fadeev avatar Dec 22 '22 09:12 fadeev