Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add protos for ibc.lightclients.localhost.v1 #143

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/143-localhost-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add proto definition for `ibc.lightclients.localhost.v1`
([\#143](https://github.com/cosmos/ibc-proto-rs/pull/143))
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
Loading