Skip to content

Conversation

@Pantani
Copy link
Collaborator

@Pantani Pantani commented Oct 27, 2021

close #1727

Issue

creator field can't be used for types when --no-message is provided

Changes

Avoid throwing an error for no message types when scaffolding a type with the creator parameter

@Pantani Pantani self-assigned this Oct 27, 2021
@Pantani Pantani requested a review from lumtis October 29, 2021 02:39
@lumtis
Copy link
Contributor

lumtis commented Oct 29, 2021

Mmh we retired the creator check which is good but now we can use it for a type with messages and the generated code is wrong:

starport s map bar creator
error while running command /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/protoc3491298116: mars/bar.proto:9:10: "creator" is already defined in "lubtd.mars.mars.Bar".
: exit status 1

I think what we can do is simply to check that the signer field for the type option is not present in fields array

@Pantani
Copy link
Collaborator Author

Pantani commented Oct 29, 2021

Mmh we retired the creator check which is good but now we can use it for a type with messages and the generated code is wrong:

starport s map bar creator
error while running command /var/folders/6n/c3hb98tx2sjdxbz0cg5fy2gm0000gn/T/protoc3491298116: mars/bar.proto:9:10: "creator" is already defined in "lubtd.mars.mars.Bar".
: exit status 1

I think what we can do is simply to check that the signer field for the type option is not present in fields array

I found some issues too. I will refactor the PR

@Pantani Pantani marked this pull request as draft October 29, 2021 13:13
@Pantani Pantani marked this pull request as ready for review October 30, 2021 03:41
Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

👍

@Pantani Pantani merged commit bc548bb into develop Nov 1, 2021
@Pantani Pantani deleted the fix/creato-param-no-message branch November 1, 2021 12:40
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
…te#1730)

* check the creator parameter only for packet scaffold

* make the check for indexes

* fix no-message for map type

* remove unecessary methods

* remove unecessary methods

* check if the signer field already exist

* fix custom creator field colision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scaffold: creator field can't be used for types when --no-message is provided

4 participants