-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
436bcfa
commit c1e1c33
Showing
490 changed files
with
83,145 additions
and
7,516 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Maintaining Cosmos SDK Proto Files | ||
|
||
All of the Cosmos SDK proto files are defined here. This folder should | ||
be synced regularly with buf.build/cosmos/cosmos-sdk regularly by | ||
a maintainer by running `buf push` in this folder. | ||
|
||
User facing documentation should not be placed here but instead goes in | ||
`buf.md` and in each protobuf package following the guidelines in | ||
https://docs.buf.build/bsr/documentation. | ||
|
||
## SDK x Buf | ||
|
||
| Cosmos SDK Version | Buf Commit Version | | ||
| ------------------ | ------------------------------------------------------------------------------------------------------------- | | ||
| Prior v0.46.0 | [Unavailable](https://github.com/bufbuild/buf/issues/1415) | | ||
| v0.46.x | [8cb30a2c4de74dc9bd8d260b1e75e176](https://buf.build/cosmos/cosmos-sdk/docs/8cb30a2c4de74dc9bd8d260b1e75e176) | | ||
| v0.47.x | [v0.47.0](https://buf.build/cosmos/cosmos-sdk/docs/v0.47.0) | | ||
| v0.50.x | [v0.50.0](https://buf.build/cosmos/cosmos-sdk/docs/v0.50.0) | | ||
| Next | [latest on buf](https://buf.build/cosmos/cosmos-sdk/commits/main) | | ||
|
||
## Generate | ||
|
||
To get the Cosmos SDK proto given a commit, run: | ||
|
||
```bash | ||
buf export buf.build/cosmos/cosmos-sdk:${commit} --output . | ||
``` |
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,84 @@ | ||
syntax = "proto3"; | ||
|
||
package amino; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. | ||
// We need this right now because gogoproto codegen needs to import the extension. | ||
option go_package = "github.com/cosmos/cosmos-sdk/types/tx/amino"; | ||
|
||
extend google.protobuf.MessageOptions { | ||
// name is the string used when registering a concrete | ||
// type into the Amino type registry, via the Amino codec's | ||
// `RegisterConcrete()` method. This string MUST be at most 39 | ||
// characters long, or else the message will be rejected by the | ||
// Ledger hardware device. | ||
string name = 11110001; | ||
|
||
// encoding describes the encoding format used by Amino for the given | ||
// message. The field type is chosen to be a string for | ||
// flexibility, but it should ideally be short and expected to be | ||
// machine-readable, for example "base64" or "utf8_json". We | ||
// highly recommend to use underscores for word separation instead of spaces. | ||
// | ||
// If left empty, then the Amino encoding is expected to be the same as the | ||
// Protobuf one. | ||
// | ||
// This annotation should not be confused with the `encoding` | ||
// one which operates on the field level. | ||
string message_encoding = 11110002; | ||
} | ||
|
||
extend google.protobuf.FieldOptions { | ||
// encoding describes the encoding format used by Amino for | ||
// the given field. The field type is chosen to be a string for | ||
// flexibility, but it should ideally be short and expected to be | ||
// machine-readable, for example "base64" or "utf8_json". We | ||
// highly recommend to use underscores for word separation instead of spaces. | ||
// | ||
// If left empty, then the Amino encoding is expected to be the same as the | ||
// Protobuf one. | ||
// | ||
// This annotation should not be confused with the | ||
// `message_encoding` one which operates on the message level. | ||
string encoding = 11110003; | ||
|
||
// field_name sets a different field name (i.e. key name) in | ||
// the amino JSON object for the given field. | ||
// | ||
// Example: | ||
// | ||
// message Foo { | ||
// string bar = 1 [(amino.field_name) = "baz"]; | ||
// } | ||
// | ||
// Then the Amino encoding of Foo will be: | ||
// `{"baz":"some value"}` | ||
string field_name = 11110004; | ||
|
||
// dont_omitempty sets the field in the JSON object even if | ||
// its value is empty, i.e. equal to the Golang zero value. To learn what | ||
// the zero values are, see https://go.dev/ref/spec#The_zero_value. | ||
// | ||
// Fields default to `omitempty`, which is the default behavior when this | ||
// annotation is unset. When set to true, then the field value in the | ||
// JSON object will be set, i.e. not `undefined`. | ||
// | ||
// Example: | ||
// | ||
// message Foo { | ||
// string bar = 1; | ||
// string baz = 2 [(amino.dont_omitempty) = true]; | ||
// } | ||
// | ||
// f := Foo{}; | ||
// out := AminoJSONEncoder(&f); | ||
// out == {"baz":""} | ||
bool dont_omitempty = 11110005; | ||
|
||
// oneof_name sets the type name for the given field oneof field. This is used | ||
// by the Amino JSON encoder to encode the type of the oneof field, and must be the same string in | ||
// the RegisterConcrete() method usage used to register the concrete type. | ||
string oneof_name = 11110006; | ||
} |
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,8 @@ | ||
version: v1 | ||
plugins: | ||
- name: gocosmos | ||
out: .. | ||
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types | ||
- name: grpc-gateway | ||
out: .. | ||
opt: logtostderr=true,allow_colon_final_segments=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,20 @@ | ||
version: v1 | ||
managed: | ||
enabled: true | ||
go_package_prefix: | ||
default: cosmossdk.io/api | ||
except: | ||
- buf.build/googleapis/googleapis | ||
- buf.build/cosmos/gogo-proto | ||
- buf.build/cosmos/cosmos-proto | ||
override: | ||
plugins: | ||
- name: go-pulsar | ||
out: ../api | ||
opt: paths=source_relative | ||
- name: go-grpc | ||
out: ../api | ||
opt: paths=source_relative | ||
- name: go-cosmos-orm | ||
out: ../api | ||
opt: paths=source_relative |
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 @@ | ||
version: v1 | ||
plugins: | ||
- name: swagger | ||
out: ../tmp-swagger-gen | ||
opt: logtostderr=true,fqn_for_swagger_name=true,simple_operation_ids=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
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,3 +1,19 @@ | ||
# Protobufs | ||
|
||
This is the public protocol buffers API for [Wasmd](https://github.com/CosmWasm/wasmd). | ||
This is the public protocol buffers API for [Wasmd](https://github.com/CosmWasm/wasmd). | ||
|
||
## Download | ||
|
||
The `buf` CLI comes with an export command. Use `buf export -h` for details | ||
|
||
#### Examples: | ||
|
||
Download cosmwasm protos for a commit: | ||
```bash | ||
buf export buf.build/cosmwasm/wasmd:${commit} --output ./tmp | ||
``` | ||
|
||
Download all project protos: | ||
```bash | ||
buf export . --output ./tmp | ||
``` |
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,32 @@ | ||
syntax = "proto3"; | ||
|
||
package capability.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "amino/amino.proto"; | ||
|
||
option go_package = "github.com/cosmos/ibc-go/modules/capability/types"; | ||
|
||
// Capability defines an implementation of an object capability. The index | ||
// provided to a Capability must be globally unique. | ||
message Capability { | ||
option (gogoproto.goproto_stringer) = false; | ||
|
||
uint64 index = 1; | ||
} | ||
|
||
// Owner defines a single capability owner. An owner is defined by the name of | ||
// capability and the module name. | ||
message Owner { | ||
option (gogoproto.goproto_stringer) = false; | ||
option (gogoproto.goproto_getters) = false; | ||
|
||
string module = 1; | ||
string name = 2; | ||
} | ||
|
||
// CapabilityOwners defines a set of owners of a single Capability. The set of | ||
// owners must be unique. | ||
message CapabilityOwners { | ||
repeated Owner owners = 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 capability.v1; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "capability/v1/capability.proto"; | ||
import "amino/amino.proto"; | ||
|
||
option go_package = "github.com/cosmos/ibc-go/modules/capability/types"; | ||
|
||
// GenesisOwners defines the capability owners with their corresponding index. | ||
message GenesisOwners { | ||
// index is the index of the capability owner. | ||
uint64 index = 1; | ||
|
||
// index_owners are the owners at the given index. | ||
CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} | ||
|
||
// GenesisState defines the capability module's genesis state. | ||
message GenesisState { | ||
// index is the capability global index. | ||
uint64 index = 1; | ||
|
||
// owners represents a map from index to owners of the capability index | ||
// index key is string to allow amino marshalling. | ||
repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; | ||
} |
Oops, something went wrong.