-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module): scaffold parameters for a module (#1716)
* add params structure * add missing params file * add testutil/keeper * add integration test for params * fix ibc testutil keeper * add params test for ibc * use types.DefaultParams for TestParamsQuery * fix identantion for plush files * add param tests for keeper * fix subspace not found * fix unused todo var * fix param subspace for testutil * fix unused import for module without params * fix condition with wrong syntax * fix integration test collision * fix dummy value index * fix dummy ValueInvalidIndex * value index should be a string not a number * prevent unused import error cor strconv * avoid use strconv for string params types * fix param index for the genesis state and some comments * add bool param into the integration test * improve todo comment for default value Co-authored-by: İlker G. Öztürk <[email protected]> Co-authored-by: Lucas Bertrand <[email protected]>
- Loading branch information
1 parent
23be58f
commit 25dbd8b
Showing
40 changed files
with
364 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
starport/templates/module/create/stargate/proto/{{moduleName}}/genesis.proto.plush
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
syntax = "proto3"; | ||
package <%= formatOwnerName(ownerName) %>.<%= appName %>.<%= moduleName %>; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "<%= moduleName %>/params.proto"; | ||
// this line is used by starport scaffolding # genesis/proto/import | ||
|
||
option go_package = "<%= modulePath %>/x/<%= moduleName %>/types"; | ||
|
||
// GenesisState defines the <%= moduleName %> module's genesis state. | ||
message GenesisState { | ||
// this line is used by starport scaffolding # genesis/proto/state | ||
Params params = 1 [(gogoproto.nullable) = false]; | ||
// this line is used by starport scaffolding # genesis/proto/state | ||
} |
13 changes: 13 additions & 0 deletions
13
starport/templates/module/create/stargate/proto/{{moduleName}}/params.proto.plush
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
syntax = "proto3"; | ||
package <%= formatOwnerName(ownerName) %>.<%= appName %>.<%= moduleName %>; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "<%= modulePath %>/x/<%= moduleName %>/types"; | ||
|
||
// Params defines the parameters for the module. | ||
message Params { | ||
option (gogoproto.goproto_stringer) = false; | ||
<%= for (i, param) in params { %> | ||
<%= param.ProtoType(i+1) %> [(gogoproto.moretags) = "yaml:\"<%= param.Name.Snake %>\""];<% } %> | ||
} |
Oops, something went wrong.