diff --git a/definitions/ibc/lightclients/localhost/v1/localhost.proto b/definitions/ibc/lightclients/localhost/v1/localhost.proto new file mode 100644 index 00000000..ad0141af --- /dev/null +++ b/definitions/ibc/lightclients/localhost/v1/localhost.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package ibc.lightclients.localhost.v1; + +option go_package = "github.com/cosmos/ibc-go/v6/modules/light-clients/09-localhost/types"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; + +// ClientState defines a loopback (localhost) client. It requires (read-only) +// access to keys outside the client prefix. +message ClientState { + option (gogoproto.goproto_getters) = false; + // self chain ID + string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""]; + // self latest block height + ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; +} diff --git a/src/lib.rs b/src/lib.rs index 9e21a9b6..7006347d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -229,6 +229,9 @@ pub mod ibc { } pub mod lightclients { pub mod localhost { + pub mod v1 { + include_proto!("ibc.lightclients.localhost.v1.rs"); + } pub mod v2 { include_proto!("ibc.lightclients.localhost.v2.rs"); } diff --git a/src/prost/ibc.lightclients.localhost.v1.rs b/src/prost/ibc.lightclients.localhost.v1.rs new file mode 100644 index 00000000..980676d1 --- /dev/null +++ b/src/prost/ibc.lightclients.localhost.v1.rs @@ -0,0 +1,12 @@ +/// ClientState defines a loopback (localhost) client. It requires (read-only) +/// access to keys outside the client prefix. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientState { + /// self chain ID + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + /// self latest block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, +} diff --git a/src/prost/proto_descriptor.bin b/src/prost/proto_descriptor.bin index 03bda7b9..45d2bf4f 100644 Binary files a/src/prost/proto_descriptor.bin and b/src/prost/proto_descriptor.bin differ diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index 3bf1421d..c828d19e 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -63,6 +63,7 @@ impl CompileCmd { // Paths let proto_paths = [ format!("{}/../../definitions/mock", root), + format!("{}/../../definitions/ibc/lightclients/localhost/v1", root), format!("{}/../../definitions/stride/interchainquery/v1", root), format!("{}/ibc", ibc_dir.display()), format!("{}/cosmos/auth", sdk_dir.display()), @@ -82,6 +83,7 @@ impl CompileCmd { format!("{}", ibc_dir.display()), format!("{}", ics_dir.display()), format!("{}/../../definitions/mock", root), + format!("{}/../../definitions/ibc/lightclients/localhost/v1", root), format!("{}/../../definitions/stride/interchainquery/v1", root), ];