Skip to content

Commit

Permalink
add wasm protos to release/v8.2.x (#5987)
Browse files Browse the repository at this point in the history
* add wasm protos

* add pb.go files

* add wasm proto files

* remove wasm pb.go files
  • Loading branch information
Carlos Rodriguez authored Mar 14, 2024
1 parent a96bf50 commit fae72e3
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* (proto) [\#5987](https://github.com/cosmos/ibc-go/pull/5987) Add wasm proto files.

### Features

* [\#5788](https://github.com/cosmos/ibc-go/pull/5788) Add `NewErrorAcknowledgementWithCodespace` to allow codespaces in ack errors.
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/transfer/types/authz.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions proto/ibc/lightclients/wasm/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

syntax = "proto3";
package ibc.lightclients.wasm.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types";

// GenesisState defines 08-wasm's keeper genesis state
message GenesisState {
// uploaded light client wasm contracts
repeated Contract contracts = 1 [(gogoproto.nullable) = false];
}

// Contract stores contract code
message Contract {
option (gogoproto.goproto_getters) = false;
// contract byte code
bytes code_bytes = 1;
}
46 changes: 46 additions & 0 deletions proto/ibc/lightclients/wasm/v1/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
syntax = "proto3";
package ibc.lightclients.wasm.v1;

import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types";

// Query service for wasm module
service Query {
// Get all Wasm checksums
rpc Checksums(QueryChecksumsRequest) returns (QueryChecksumsResponse) {
option (google.api.http).get = "/ibc/lightclients/wasm/v1/checksums";
}

// Get Wasm code for given checksum
rpc Code(QueryCodeRequest) returns (QueryCodeResponse) {
option (google.api.http).get = "/ibc/lightclients/wasm/v1/checksums/{checksum}/code";
}
}

// QueryChecksumsRequest is the request type for the Query/Checksums RPC method.
message QueryChecksumsRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

// QueryChecksumsResponse is the response type for the Query/Checksums RPC method.
message QueryChecksumsResponse {
// checksums is a list of the hex encoded checksums of all wasm codes stored.
repeated string checksums = 1;

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryCodeRequest is the request type for the Query/Code RPC method.
message QueryCodeRequest {
// checksum is a hex encoded string of the code stored.
string checksum = 1;
}

// QueryCodeResponse is the response type for the Query/Code RPC method.
message QueryCodeResponse {
bytes data = 1;
}
66 changes: 66 additions & 0 deletions proto/ibc/lightclients/wasm/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
syntax = "proto3";
package ibc.lightclients.wasm.v1;

option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types";

import "cosmos/msg/v1/msg.proto";

// Msg defines the ibc/08-wasm Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;

// StoreCode defines a rpc handler method for MsgStoreCode.
rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse);

// RemoveChecksum defines a rpc handler method for MsgRemoveChecksum.
rpc RemoveChecksum(MsgRemoveChecksum) returns (MsgRemoveChecksumResponse);

// MigrateContract defines a rpc handler method for MsgMigrateContract.
rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse);
}

// MsgStoreCode defines the request type for the StoreCode rpc.
message MsgStoreCode {
option (cosmos.msg.v1.signer) = "signer";

// signer address
string signer = 1;
// wasm byte code of light client contract. It can be raw or gzip compressed
bytes wasm_byte_code = 2;
}

// MsgStoreCodeResponse defines the response type for the StoreCode rpc
message MsgStoreCodeResponse {
// checksum is the sha256 hash of the stored code
bytes checksum = 1;
}

// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc.
message MsgRemoveChecksum {
option (cosmos.msg.v1.signer) = "signer";

// signer address
string signer = 1;
// checksum is the sha256 hash to be removed from the store
bytes checksum = 2;
}

// MsgStoreChecksumResponse defines the response type for the StoreCode rpc
message MsgRemoveChecksumResponse {}

// MsgMigrateContract defines the request type for the MigrateContract rpc.
message MsgMigrateContract {
option (cosmos.msg.v1.signer) = "signer";

// signer address
string signer = 1;
// the client id of the contract
string client_id = 2;
// checksum is the sha256 hash of the new wasm byte code for the contract
bytes checksum = 3;
// the json encoded message to be passed to the contract on migration
bytes msg = 4;
}

// MsgMigrateContractResponse defines the response type for the MigrateContract rpc
message MsgMigrateContractResponse {}
43 changes: 43 additions & 0 deletions proto/ibc/lightclients/wasm/v1/wasm.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

syntax = "proto3";
package ibc.lightclients.wasm.v1;

import "gogoproto/gogo.proto";
import "ibc/core/client/v1/client.proto";

option go_package = "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/types";

// Wasm light client's Client state
message ClientState {
option (gogoproto.goproto_getters) = false;
// bytes encoding the client state of the underlying light client
// implemented as a Wasm contract.
bytes data = 1;
bytes checksum = 2;
ibc.core.client.v1.Height latest_height = 3 [(gogoproto.nullable) = false];
}

// Wasm light client's ConsensusState
message ConsensusState {
option (gogoproto.goproto_getters) = false;
// bytes encoding the consensus state of the underlying light client
// implemented as a Wasm contract.
bytes data = 1;
}

// Wasm light client message (either header(s) or misbehaviour)
message ClientMessage {
option (gogoproto.goproto_getters) = false;

bytes data = 1;
}

// Checksums defines a list of all checksums that are stored
//
// Deprecated: This message is deprecated in favor of storing the checksums
// using a Collections.KeySet.
message Checksums {
option deprecated = true;

repeated bytes checksums = 1;
}

0 comments on commit fae72e3

Please sign in to comment.