Skip to content

Commit

Permalink
Run proto-all on protos (#1923)
Browse files Browse the repository at this point in the history
nullpointer0x00 authored Apr 11, 2024
1 parent ee6b992 commit d968b6d
Showing 14 changed files with 561 additions and 18 deletions.
13 changes: 13 additions & 0 deletions third_party/proto/cosmos/authz/v1beta1/authz.proto
Original file line number Diff line number Diff line change
@@ -21,6 +21,19 @@ message GenericAuthorization {
string msg = 1;
}

// CountAuthorization gives the grantee unrestricted permissions to execute
// the provided method on behalf of the granter's account up to the allowed authorizations count.
message CountAuthorization {
option (amino.name) = "cosmos-sdk/CountAuthorization";
option (cosmos_proto.implements_interface) = "cosmos.authz.v1beta1.Authorization";

// Msg, identified by it's type URL, to grant unrestricted permissions to execute
string msg = 1;

// Allowed number of authorizations assigned to grantee
int32 allowed_authorizations = 2;
}

// Grant gives permissions to execute
// the provide method with expiration time.
message Grant {
19 changes: 19 additions & 0 deletions third_party/proto/cosmos/bank/v1beta1/tx.proto
Original file line number Diff line number Diff line change
@@ -33,6 +33,9 @@ service Msg {
//
// Since: cosmos-sdk 0.47
rpc SetSendEnabled(MsgSetSendEnabled) returns (MsgSetSendEnabledResponse);

// UpdateDenomMetadata defines a method for updating the denom metadata. Only usable in x/gov proposal.
rpc UpdateDenomMetadata(MsgUpdateDenomMetadata) returns (MsgUpdateDenomMetadataResponse);
}

// MsgSend represents a message to send coins from one account to another.
@@ -122,3 +125,19 @@ message MsgSetSendEnabled {
//
// Since: cosmos-sdk 0.47
message MsgSetSendEnabledResponse {}

// MsgUpdateDenomMetadata defines the Msg/UpdateDenomMetadata request type.
message MsgUpdateDenomMetadata {
option (cosmos.msg.v1.signer) = "from_address";

option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string title = 2;
string description = 3;
Metadata metadata = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// MsgUpdateDenomMetadataResponse defines the Msg/UpdateDenomMetadata response type.
message MsgUpdateDenomMetadataResponse {}
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import "gogoproto/gogo.proto";
import "ibc/applications/interchain_accounts/v1/packet.proto";
import "ibc/applications/interchain_accounts/controller/v1/controller.proto";
import "cosmos/msg/v1/msg.proto";
import "ibc/core/channel/v1/channel.proto";

// Msg defines the 27-interchain-accounts/controller Msg service.
service Msg {
@@ -27,9 +28,10 @@ message MsgRegisterInterchainAccount {

option (gogoproto.goproto_getters) = false;

string owner = 1;
string connection_id = 2;
string version = 3;
string owner = 1;
string connection_id = 2;
string version = 3;
ibc.core.channel.v1.Order ordering = 4;
}

// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount
3 changes: 3 additions & 0 deletions third_party/proto/ibc/applications/transfer/v1/authz.proto
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@ message Allocation {
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
// allow list of receivers, an empty allow list permits any receiver address
repeated string allow_list = 4;
// allow list of packet data keys, an empty list prohibits all packet data keys;
// a list only with "*" permits any packet data key
repeated string allowed_packet_data = 5;
}

// TransferAuthorization allows the grantee to spend up to spend_limit coins from
Original file line number Diff line number Diff line change
@@ -25,4 +25,4 @@ message Params {
// receive_enabled enables or disables all cross-chain token transfers to this
// chain.
bool receive_enabled = 2;
}
}
18 changes: 17 additions & 1 deletion third_party/proto/ibc/core/channel/v1/channel.proto
Original file line number Diff line number Diff line change
@@ -24,6 +24,9 @@ message Channel {
repeated string connection_hops = 4;
// opaque channel version, which is agreed upon during the handshake
string version = 5;
// upgrade sequence indicates the latest upgrade attempt performed by this channel
// the value of 0 indicates the channel has never been upgraded
uint64 upgrade_sequence = 6;
}

// IdentifiedChannel defines a channel with additional port and channel
@@ -46,10 +49,13 @@ message IdentifiedChannel {
string port_id = 6;
// channel identifier
string channel_id = 7;
// upgrade sequence indicates the latest upgrade attempt performed by this channel
// the value of 0 indicates the channel has never been upgraded
uint64 upgrade_sequence = 8;
}

// State defines if a channel is in one of the following states:
// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED.
// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED.
enum State {
option (gogoproto.goproto_enum_prefix) = false;

@@ -65,6 +71,10 @@ enum State {
// A channel has been closed and can no longer be used to send or receive
// packets.
STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"];
// A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets.
STATE_FLUSHING = 5 [(gogoproto.enumvalue_customname) = "FLUSHING"];
// A channel has just completed flushing any in-flight packets.
STATE_FLUSHCOMPLETE = 6 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"];
}

// Order defines if a channel is ORDERED or UNORDERED
@@ -169,3 +179,9 @@ message Timeout {
// block timestamp (in nanoseconds) after which the packet or upgrade times out
uint64 timestamp = 2;
}

// Params defines the set of IBC channel parameters.
message Params {
// the relative timeout after which channel upgrades will time out.
Timeout upgrade_timeout = 1 [(gogoproto.nullable) = false];
}
1 change: 1 addition & 0 deletions third_party/proto/ibc/core/channel/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ message GenesisState {
repeated PacketSequence ack_sequences = 7 [(gogoproto.nullable) = false];
// the sequence for the next generated channel identifier
uint64 next_channel_sequence = 8;
Params params = 9 [(gogoproto.nullable) = false];
}

// PacketSequence defines the genesis type necessary to retrieve and store
59 changes: 58 additions & 1 deletion third_party/proto/ibc/core/channel/v1/query.proto
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import "ibc/core/channel/v1/channel.proto";
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";
import "ibc/core/channel/v1/upgrade.proto";

// Query provides defines the gRPC querier service
service Query {
@@ -104,6 +105,23 @@ service Query {
option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
"ports/{port_id}/next_sequence_send";
}

// UpgradeError returns the error receipt if the upgrade handshake failed.
rpc UpgradeError(QueryUpgradeErrorRequest) returns (QueryUpgradeErrorResponse) {
option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
"ports/{port_id}/upgrade_error";
}

// Upgrade returns the upgrade for a given port and channel id.
rpc Upgrade(QueryUpgradeRequest) returns (QueryUpgradeResponse) {
option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/"
"ports/{port_id}/upgrade";
}

// ChannelParams queries all parameters of the ibc channel submodule.
rpc ChannelParams(QueryChannelParamsRequest) returns (QueryChannelParamsResponse) {
option (google.api.http).get = "/ibc/core/channel/v1/params";
}
}

// QueryChannelRequest is the request type for the Query/Channel RPC method
@@ -370,7 +388,7 @@ message QueryNextSequenceReceiveRequest {
string channel_id = 2;
}

// QuerySequenceResponse is the request type for the
// QuerySequenceResponse is the response type for the
// Query/QueryNextSequenceReceiveResponse RPC method
message QueryNextSequenceReceiveResponse {
// next sequence receive number
@@ -399,4 +417,43 @@ message QueryNextSequenceSendResponse {
bytes proof = 2;
// height at which the proof was retrieved
ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
}

// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method
message QueryUpgradeErrorRequest {
string port_id = 1;
string channel_id = 2;
}

// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method
message QueryUpgradeErrorResponse {
ErrorReceipt error_receipt = 1 [(gogoproto.nullable) = false];
// merkle proof of existence
bytes proof = 2;
// height at which the proof was retrieved
ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
}

// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method
message QueryUpgradeRequest {
string port_id = 1;
string channel_id = 2;
}

// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method
message QueryUpgradeResponse {
Upgrade upgrade = 1 [(gogoproto.nullable) = false];
// merkle proof of existence
bytes proof = 2;
// height at which the proof was retrieved
ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false];
}

// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method.
message QueryChannelParamsRequest {}

// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method.
message QueryChannelParamsResponse {
// params defines the parameters of the module.
Params params = 1;
}
238 changes: 226 additions & 12 deletions third_party/proto/ibc/core/channel/v1/tx.proto
Original file line number Diff line number Diff line change
@@ -5,9 +5,10 @@ package ibc.core.channel.v1;
option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types";

import "gogoproto/gogo.proto";
import "cosmos/msg/v1/msg.proto";
import "ibc/core/client/v1/client.proto";
import "ibc/core/channel/v1/channel.proto";
import "cosmos/msg/v1/msg.proto";
import "ibc/core/channel/v1/upgrade.proto";

// Msg defines the ibc/channel Msg service.
service Msg {
@@ -43,6 +44,33 @@ service Msg {

// Acknowledgement defines a rpc handler method for MsgAcknowledgement.
rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse);

// ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit.
rpc ChannelUpgradeInit(MsgChannelUpgradeInit) returns (MsgChannelUpgradeInitResponse);

// ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry.
rpc ChannelUpgradeTry(MsgChannelUpgradeTry) returns (MsgChannelUpgradeTryResponse);

// ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck.
rpc ChannelUpgradeAck(MsgChannelUpgradeAck) returns (MsgChannelUpgradeAckResponse);

// ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm.
rpc ChannelUpgradeConfirm(MsgChannelUpgradeConfirm) returns (MsgChannelUpgradeConfirmResponse);

// ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen.
rpc ChannelUpgradeOpen(MsgChannelUpgradeOpen) returns (MsgChannelUpgradeOpenResponse);

// ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout.
rpc ChannelUpgradeTimeout(MsgChannelUpgradeTimeout) returns (MsgChannelUpgradeTimeoutResponse);

// ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel.
rpc ChannelUpgradeCancel(MsgChannelUpgradeCancel) returns (MsgChannelUpgradeCancelResponse);

// UpdateChannelParams defines a rpc handler method for MsgUpdateParams.
rpc UpdateChannelParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);

// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements.
rpc PruneAcknowledgements(MsgPruneAcknowledgements) returns (MsgPruneAcknowledgementsResponse);
}

// ResponseResultType defines the possible outcomes of the execution of a message
@@ -55,6 +83,8 @@ enum ResponseResultType {
RESPONSE_RESULT_TYPE_NOOP = 1 [(gogoproto.enumvalue_customname) = "NOOP"];
// The message was executed successfully
RESPONSE_RESULT_TYPE_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "SUCCESS"];
// The message was executed unsuccessfully
RESPONSE_RESULT_TYPE_FAILURE = 3 [(gogoproto.enumvalue_customname) = "FAILURE"];
}

// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It
@@ -106,6 +136,9 @@ message MsgChannelOpenTryResponse {

// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge
// the change of channel state to TRYOPEN on Chain B.
// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel
// in the same block as executing this message otherwise the counterparty will
// be incapable of opening.
message MsgChannelOpenAck {
option (cosmos.msg.v1.signer) = "signer";

@@ -163,11 +196,12 @@ message MsgChannelCloseConfirm {

option (gogoproto.goproto_getters) = false;

string port_id = 1;
string channel_id = 2;
bytes proof_init = 3;
ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false];
string signer = 5;
string port_id = 1;
string channel_id = 2;
bytes proof_init = 3;
ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false];
string signer = 5;
uint64 counterparty_upgrade_sequence = 6;
}

// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response
@@ -219,12 +253,13 @@ message MsgTimeoutOnClose {

option (gogoproto.goproto_getters) = false;

Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof_unreceived = 2;
bytes proof_close = 3;
ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false];
uint64 next_sequence_recv = 5;
string signer = 6;
Packet packet = 1 [(gogoproto.nullable) = false];
bytes proof_unreceived = 2;
bytes proof_close = 3;
ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false];
uint64 next_sequence_recv = 5;
string signer = 6;
uint64 counterparty_upgrade_sequence = 7;
}

// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type.
@@ -253,3 +288,182 @@ message MsgAcknowledgementResponse {

ResponseResultType result = 1;
}

// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc
// WARNING: Initializing a channel upgrade in the same block as opening the channel
// may result in the counterparty being incapable of opening.
message MsgChannelUpgradeInit {
option (cosmos.msg.v1.signer) = "signer";

option (gogoproto.goproto_getters) = false;

string port_id = 1;
string channel_id = 2;
UpgradeFields fields = 3 [(gogoproto.nullable) = false];
string signer = 4;
}

// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type
message MsgChannelUpgradeInitResponse {
option (gogoproto.goproto_getters) = false;

Upgrade upgrade = 1 [(gogoproto.nullable) = false];
uint64 upgrade_sequence = 2;
}

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

option (gogoproto.goproto_getters) = false;

string port_id = 1;
string channel_id = 2;
repeated string proposed_upgrade_connection_hops = 3;
UpgradeFields counterparty_upgrade_fields = 4 [(gogoproto.nullable) = false];
uint64 counterparty_upgrade_sequence = 5;
bytes proof_channel = 6;
bytes proof_upgrade = 7;
ibc.core.client.v1.Height proof_height = 8 [(gogoproto.nullable) = false];
string signer = 9;
}

// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type
message MsgChannelUpgradeTryResponse {
option (gogoproto.goproto_getters) = false;

Upgrade upgrade = 1 [(gogoproto.nullable) = false];
uint64 upgrade_sequence = 2;
ResponseResultType result = 3;
}

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

option (gogoproto.goproto_getters) = false;
string port_id = 1;
string channel_id = 2;
Upgrade counterparty_upgrade = 3 [(gogoproto.nullable) = false];
bytes proof_channel = 4;
bytes proof_upgrade = 5;
ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false];
string signer = 7;
}

// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type
message MsgChannelUpgradeAckResponse {
option (gogoproto.goproto_getters) = false;

ResponseResultType result = 1;
}

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

option (gogoproto.goproto_getters) = false;
string port_id = 1;
string channel_id = 2;
State counterparty_channel_state = 3;
Upgrade counterparty_upgrade = 4 [(gogoproto.nullable) = false];
bytes proof_channel = 5;
bytes proof_upgrade = 6;
ibc.core.client.v1.Height proof_height = 7 [(gogoproto.nullable) = false];
string signer = 8;
}

// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type
message MsgChannelUpgradeConfirmResponse {
option (gogoproto.goproto_getters) = false;

ResponseResultType result = 1;
}

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

option (gogoproto.goproto_getters) = false;
string port_id = 1;
string channel_id = 2;
State counterparty_channel_state = 3;
uint64 counterparty_upgrade_sequence = 4;
bytes proof_channel = 5;
ibc.core.client.v1.Height proof_height = 6 [(gogoproto.nullable) = false];
string signer = 7;
}

// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type
message MsgChannelUpgradeOpenResponse {}

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

option (gogoproto.goproto_getters) = false;

string port_id = 1;
string channel_id = 2;
Channel counterparty_channel = 3 [(gogoproto.nullable) = false];
bytes proof_channel = 4;
ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false];
string signer = 6;
}

// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type
message MsgChannelUpgradeTimeoutResponse {}

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

option (gogoproto.goproto_getters) = false;

string port_id = 1;
string channel_id = 2;
ErrorReceipt error_receipt = 3 [(gogoproto.nullable) = false];
bytes proof_error_receipt = 4;
ibc.core.client.v1.Height proof_height = 5 [(gogoproto.nullable) = false];
string signer = 6;
}

// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type
message MsgChannelUpgradeCancelResponse {}

// MsgUpdateParams is the MsgUpdateParams request type.
message MsgUpdateParams {
option (cosmos.msg.v1.signer) = "authority";

option (gogoproto.goproto_getters) = false;

// authority is the address that controls the module (defaults to x/gov unless overwritten).
string authority = 1;

// params defines the channel parameters to update.
//
// NOTE: All parameters must be supplied.
Params params = 2 [(gogoproto.nullable) = false];
}

// MsgUpdateParamsResponse defines the MsgUpdateParams response type.
message MsgUpdateParamsResponse {}

// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc.
message MsgPruneAcknowledgements {
option (cosmos.msg.v1.signer) = "signer";
option (gogoproto.goproto_getters) = false;

string port_id = 1;
string channel_id = 2;
uint64 limit = 3;
string signer = 4;
}

// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc.
message MsgPruneAcknowledgementsResponse {
// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate).
uint64 total_pruned_sequences = 1;
// Number of sequences left after pruning.
uint64 total_remaining_sequences = 2;
}
43 changes: 43 additions & 0 deletions third_party/proto/ibc/core/channel/v1/upgrade.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
syntax = "proto3";

package ibc.core.channel.v1;

option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types";

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

// Upgrade is a verifiable type which contains the relevant information
// for an attempted upgrade. It provides the proposed changes to the channel
// end, the timeout for this upgrade attempt and the next packet sequence
// which allows the counterparty to efficiently know the highest sequence it has received.
// The next sequence send is used for pruning and upgrading from unordered to ordered channels.
message Upgrade {
option (gogoproto.goproto_getters) = false;

UpgradeFields fields = 1 [(gogoproto.nullable) = false];
Timeout timeout = 2 [(gogoproto.nullable) = false];
uint64 next_sequence_send = 3;
}

// UpgradeFields are the fields in a channel end which may be changed
// during a channel upgrade.
message UpgradeFields {
option (gogoproto.goproto_getters) = false;

Order ordering = 1;
repeated string connection_hops = 2;
string version = 3;
}

// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the
// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the
// next sequence.
message ErrorReceipt {
option (gogoproto.goproto_getters) = false;

// the channel upgrade sequence
uint64 sequence = 1;
// the error message detailing the cause of failure
string message = 2;
}
20 changes: 20 additions & 0 deletions third_party/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 third_party/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 third_party/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 third_party/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 d968b6d

Please sign in to comment.