Skip to content

Commit

Permalink
update to v0.50 cosmos-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
tubackkhoa committed Nov 13, 2024
1 parent 436bcfa commit c1e1c33
Show file tree
Hide file tree
Showing 490 changed files with 83,145 additions and 7,516 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COSMOS_WASM_DIR=${COSMOS_WASM_DIR:-$(go list -f "{{ .Dir }}" -m github.com/CosmW
IBC_DIR=${IBC_DIR:-$(go list -f "{{ .Dir }}" -m github.com/cosmos/ibc-go/v4)}

# copy all proto files
cp -r $PROJECTDIR/proto/* $COSMOS_SDK_DIR/proto/* $COSMOS_SDK_DIR/third_party/proto/* $IBC_DIR/proto/* $COSMOS_WASM_DIR/proto/* proto
cp -r $PROJECTDIR/proto/* $COSMOS_SDK_DIR/proto/* $IBC_DIR/proto/* $COSMOS_WASM_DIR/proto/* proto

telescope transpile
```
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"url": "https://github.com/tubackkhoa/@oraichain/proto/issues"
},
"devDependencies": {
"@cosmology/telescope": "^1.0.1",
"@cosmology/telescope": "^1.10.8",
"@types/jest": "^29.5.0",
"@types/node": "^20.12.7",
"eslint": "8.45.0",
Expand All @@ -57,10 +57,10 @@
"typescript": "^5.0.4"
},
"dependencies": {
"@cosmjs/amino": "0.29.4",
"@cosmjs/proto-signing": "0.29.4",
"@cosmjs/stargate": "0.29.4",
"@cosmjs/tendermint-rpc": "^0.29.4",
"@cosmjs/amino": "^0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
"@cosmjs/stargate": "^0.32.4",
"@cosmjs/tendermint-rpc": "^0.32.4",
"@cosmology/lcd": "^0.13.3"
}
}
27 changes: 27 additions & 0 deletions proto/README.md
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 .
```
84 changes: 84 additions & 0 deletions proto/amino/amino.proto
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;
}
8 changes: 8 additions & 0 deletions proto/buf.gen.gogo.yaml
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
20 changes: 20 additions & 0 deletions proto/buf.gen.pulsar.yaml
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
5 changes: 5 additions & 0 deletions proto/buf.gen.swagger.yaml
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
13 changes: 11 additions & 2 deletions proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@ deps:
owner: cosmos
repository: cosmos-proto
commit: 1935555c206d4afb9e94615dfd0fad31
digest: shake256:c74d91a3ac7ae07d579e90eee33abf9b29664047ac8816500cf22c081fec0d72d62c89ce0bebafc1f6fec7aa5315be72606717740ca95007248425102c365377
- remote: buf.build
owner: cosmos
repository: cosmos-sdk
commit: 8cb30a2c4de74dc9bd8d260b1e75e176
commit: 5a6ab7bc14314acaa912d5e53aef1c2f
digest: shake256:02c00c73493720055f9b57553a35b5550023a3c1914123b247956288a78fb913aff70e66552777ae14d759467e119079d484af081264a5dd607a94d9fbc8116b
- remote: buf.build
owner: cosmos
repository: gogo-proto
commit: 6652e3443c3b4504bb3bf82e73a7e409
commit: 34d970b699f84aa382f3c29773a60836
digest: shake256:3d3bee5229ba579e7d19ffe6e140986a228b48a8c7fe74348f308537ab95e9135210e81812489d42cd8941d33ff71f11583174ccc5972e86e6112924b6ce9f04
- remote: buf.build
owner: cosmos
repository: ics23
commit: 55085f7c710a45f58fa09947208eb70b
digest: shake256:9bf0bc495b5a11c88d163d39ef521bc4b00bc1374a05758c91d82821bdc61f09e8c2c51dda8452529bf80137f34d852561eacbe9550a59015d51cecb0dacb628
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 8d7204855ec14631a499bd7393ce1970
digest: shake256:40bf4112960cad01281930beed85829910768e32e80e986791596853eccd42c0cbd9d96690b918f658020d2d427e16f8b6514e2ac7f4a10306fd32e77be44329
18 changes: 17 additions & 1 deletion proto/buf.md
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
```
13 changes: 5 additions & 8 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Generated by "buf config migrate-v1beta1". Edit as necessary, and
# remove this comment when you're finished.
#
# This module represents the "proto" root found in
# the previous configuration.
version: v1
name: buf.build/cosmwasm/wasmd
deps:
- buf.build/cosmos/cosmos-proto
- buf.build/cosmos/cosmos-sdk:8cb30a2c4de74dc9bd8d260b1e75e176 #v0.46.x
- buf.build/cosmos/gogo-proto
- buf.build/cosmos/cosmos-sdk:v0.50.0
- buf.build/cosmos/cosmos-proto:1935555c206d4afb9e94615dfd0fad31
- buf.build/cosmos/gogo-proto:a14993478f40695898ed8a86931094b6656e8a5d
- buf.build/googleapis/googleapis:8d7204855ec14631a499bd7393ce1970
- buf.build/cosmos/ics23:b1abd8678aab07165efd453c96796a179eb3131f
breaking:
use:
- FILE
Expand Down
32 changes: 32 additions & 0 deletions proto/capability/v1/capability.proto
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];
}
28 changes: 28 additions & 0 deletions proto/capability/v1/genesis.proto
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];
}
Loading

0 comments on commit c1e1c33

Please sign in to comment.