Skip to content

Conversation

@lumtis
Copy link
Contributor

@lumtis lumtis commented Mar 7, 2021

starport message foo "Create a foo" bar foobar:int barfoo:bool --res foo,bar

Will generates:

func (k msgServer) Foo(goCtx context.Context, msg *types.MsgFoo) (*types.MsgFooResponse, error) {
	ctx := sdk.UnwrapSDKContext(goCtx)

	// TODO: Handling the message

	return &types.MsgFooResponse{}, nil
}

in msg_server_foo.go

@lumtis lumtis requested review from fadeev and ilgooz as code owners March 7, 2021 14:02
@fadeev
Copy link
Contributor

fadeev commented Mar 7, 2021

Really like this functionality! 🔥 I would probably make description optional with a flag --desc and -d (default can be "Broadcast message $message_name"), and, perhaps, --response with -r.

Also, aren't we better off creating new files, instead of doing string replacement? I'm thinking about scaffolding message_foo.proto instead.

@lumtis lumtis marked this pull request as draft March 8, 2021 09:31
@lumtis lumtis marked this pull request as ready for review March 8, 2021 09:59
fadeev
fadeev previously approved these changes Mar 8, 2021
Copy link
Contributor

@fadeev fadeev left a comment

Choose a reason for hiding this comment

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

👏

@lumtis lumtis linked an issue Mar 8, 2021 that may be closed by this pull request
Copy link
Member

@ilgooz ilgooz left a comment

Choose a reason for hiding this comment

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

Nice work! 🍷

@ltacker can we rm *-packr.go files? Btw, I'm really curious how they are generated even, because we removed packr boxes and switched to embed. Are you using an older version of our Makefile by any chance?

@lumtis
Copy link
Contributor Author

lumtis commented Mar 9, 2021

I don't know maybe a merging issue

@lumtis lumtis requested review from fadeev and ilgooz March 9, 2021 08:52
@ilgooz ilgooz merged commit 89b050f into develop Mar 9, 2021
@ilgooz ilgooz deleted the feat/scaffold-message branch March 9, 2021 11:20
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
* Templates

* Scaffolder

* Add command

* Tests for message

* Fix some bugs

* Makes description optional

* Format

* Fix response field

* Remove pack
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 message with empty placeholder

4 participants