Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
Add ibc.mock proto definitions (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
romac authored Sep 15, 2020
1 parent b7075b9 commit 5699b7d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ibc_prost_compiler/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ use walkdir::WalkDir;
fn main() {
// Paths
let proto_paths = [
"../proto/mock",
"../cosmos-sdk/proto/ibc",
"../cosmos-sdk/proto/cosmos/tx",
"../cosmos-sdk/proto/cosmos/base",
];
let proto_includes_paths = ["../cosmos-sdk/proto", "../cosmos-sdk/third_party/proto"];
let proto_includes_paths = [
"../proto",
"../cosmos-sdk/proto",
"../cosmos-sdk/third_party/proto",
];

// List available proto files
let mut protos: Vec<PathBuf> = vec![];
Expand Down
3 changes: 3 additions & 0 deletions ibc_proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ pub mod ibc {
pub mod types {
include!("prost/ibc.types.rs");
}
pub mod mock {
include!("prost/ibc.mock.rs");
}
}

pub mod ics23 {
Expand Down
10 changes: 10 additions & 0 deletions ibc_proto/src/prost/ibc.mock.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Header {
#[prost(message, optional, tag="1")]
pub height: ::std::option::Option<super::client::Height>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientState {
#[prost(message, optional, tag="1")]
pub header: ::std::option::Option<Header>,
}
12 changes: 12 additions & 0 deletions proto/mock/ibc.mock.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";
package ibc.mock;

import "ibc/client/client.proto";

message Header {
ibc.client.Height height = 1;
}

message ClientState {
Header header = 1;
}

0 comments on commit 5699b7d

Please sign in to comment.