-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bank/v2): create module boilerplate (#21559)
- Loading branch information
1 parent
dce0365
commit c7c3fa7
Showing
36 changed files
with
2,785 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syntax = "proto3"; | ||
|
||
package cosmos.bank.module.v2; | ||
|
||
import "cosmos/app/v1alpha1/module.proto"; | ||
|
||
option go_package = "cosmossdk.io/x/bank/v2/types/module"; | ||
|
||
// Module is the config object of the bank module. | ||
message Module { | ||
option (cosmos.app.v1alpha1.module) = { | ||
go_import: "cosmossdk.io/x/bank/v2" | ||
}; | ||
|
||
// authority defines the custom module authority. If not set, defaults to the governance module. | ||
string authority = 1; | ||
} |
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,7 @@ | ||
syntax = "proto3"; | ||
package cosmos.bank.v2; | ||
|
||
option go_package = "cosmossdk.io/x/bank/v2/types"; | ||
|
||
// Params defines the parameters for the bank/v2 module. | ||
message Params {} |
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,14 @@ | ||
syntax = "proto3"; | ||
package cosmos.bank.v2; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/bank/v2/bank.proto"; | ||
import "amino/amino.proto"; | ||
|
||
option go_package = "cosmossdk.io/x/bank/v2/types"; | ||
|
||
// GenesisState defines the bank/v2 module's genesis state. | ||
message GenesisState { | ||
// params defines all the parameters of the module. | ||
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} |
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,28 @@ | ||
syntax = "proto3"; | ||
package cosmos.bank.v2; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/api/annotations.proto"; | ||
import "cosmos/query/v1/query.proto"; | ||
import "amino/amino.proto"; | ||
import "cosmos/bank/v2/bank.proto"; | ||
|
||
option go_package = "cosmossdk.io/x/bank/v2/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query { | ||
// Params queries the parameters of x/bank module. | ||
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { | ||
option (cosmos.query.v1.module_query_safe) = true; | ||
option (google.api.http).get = "/cosmos/bank/v2/params"; | ||
} | ||
} | ||
|
||
// QueryParamsRequest defines the request type for querying x/bank/v2 parameters. | ||
message QueryParamsRequest {} | ||
|
||
// QueryParamsResponse defines the response type for querying x/bank/v2 parameters. | ||
message QueryParamsResponse { | ||
// params provides the parameters of the bank module. | ||
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} |
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,35 @@ | ||
syntax = "proto3"; | ||
package cosmos.bank.v2; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "cosmos/bank/v2/bank.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "cosmos/msg/v1/msg.proto"; | ||
import "amino/amino.proto"; | ||
|
||
option go_package = "cosmossdk.io/x/bank/v2/types"; | ||
|
||
// Msg defines the bank Msg service. | ||
service Msg { | ||
option (cosmos.msg.v1.service) = true; | ||
|
||
// UpdateParams defines a governance operation for updating the x/bank/v2 module parameters. | ||
// The authority is defined in the keeper. | ||
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse) {} | ||
} | ||
|
||
// MsgUpdateParams is the Msg/UpdateParams request type. | ||
message MsgUpdateParams { | ||
option (cosmos.msg.v1.signer) = "authority"; | ||
option (amino.name) = "cosmos-sdk/x/bank/v2/MsgUpdateParams"; | ||
|
||
// authority is the address that controls the module (defaults to x/gov unless overwritten). | ||
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; | ||
|
||
// params defines the x/bank parameters to update. | ||
// NOTE: All parameters must be supplied. | ||
Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} | ||
|
||
// MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. | ||
message MsgUpdateParamsResponse {} |
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,26 @@ | ||
<!-- | ||
Guiding Principles: | ||
Changelogs are for humans, not machines. | ||
There should be an entry for every single version. | ||
The same types of changes should be grouped. | ||
Versions and sections should be linkable. | ||
The latest version comes first. | ||
The release date of each version is displayed. | ||
Mention whether you follow Semantic Versioning. | ||
Usage: | ||
Change log entries are to be added to the Unreleased section under the | ||
appropriate stanza (see below). Each entry should ideally include a tag and | ||
the Github issue reference in the following format: | ||
* (<tag>) [#<issue-number>] Changelog message. | ||
Types of changes (Stanzas): | ||
"Features" for new features. | ||
"Improvements" for changes in existing functionality. | ||
"Deprecated" for soon-to-be removed features. | ||
"Bug Fixes" for any bug fixes. | ||
"API Breaking" for breaking exported APIs used by developers building on SDK. | ||
Ref: https://keepachangelog.com/en/1.0.0/ | ||
--> | ||
|
||
# Changelog | ||
|
||
## [Unreleased] |
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,5 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# `x/bank/v2` |
Oops, something went wrong.