Skip to content

Commit

Permalink
Add protos for ibc.lightclients.localhost.v1
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Sep 14, 2023
1 parent 72f63f2 commit d206a51
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
18 changes: 18 additions & 0 deletions definitions/ibc/lightclients/localhost/v1/localhost.proto
Original file line number Diff line number Diff line change
@@ -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];
}
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
12 changes: 12 additions & 0 deletions src/prost/ibc.lightclients.localhost.v1.rs
Original file line number Diff line number Diff line change
@@ -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<super::super::super::core::client::v1::Height>,
}
Binary file modified src/prost/proto_descriptor.bin
Binary file not shown.
2 changes: 2 additions & 0 deletions tools/proto-compiler/src/cmd/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand All @@ -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),
];

Expand Down

0 comments on commit d206a51

Please sign in to comment.