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

Fix clash between re-exported modules causing glitches in documentation #9

Merged
merged 7 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from 6 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: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion ibc_prost_compiler/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use walkdir::WalkDir;

fn main() {
// Paths
let proto_paths = ["../cosmos-sdk/proto/ibc", "../cosmos-sdk/proto/cosmos/tx"];
let proto_paths = [
"../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"];

// List available proto files
Expand Down
2 changes: 1 addition & 1 deletion ibc_proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-proto"
version = "0.2.0"
version = "0.3.0"
authors = ["Greg Szabo <greg@informal.systems>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
53 changes: 36 additions & 17 deletions ibc_proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,55 @@

#![deny(
warnings,
missing_docs,
// missing_docs,
trivial_casts,
trivial_numeric_casts,
unused_import_braces
)]
#![allow(clippy::large_enum_variant)]
#![forbid(unsafe_code)]
#![doc(html_root_url = "https://docs.rs/ibc-proto/0.1.0")]

mod cosmos {
pub mod cosmos {
pub mod base {
pub mod v1beta1 {
include!("prost/cosmos.base.v1beta1.rs");
}
pub mod query {
pub mod abci {
pub mod v1beta1 {
include!("prost/cosmos.base.query.v1beta1.rs");
include!("prost/cosmos.base.abci.v1beta1.rs");
}
}
pub mod crypto {
pub mod v1beta1 {
include!("prost/cosmos.base.crypto.v1beta1.rs");
}
}
pub mod kv {
pub mod v1beta1 {
include!("prost/cosmos.base.kv.v1beta1.rs");
}
}
pub mod query {
pub mod v1beta1 {
include!("prost/cosmos.base.query.v1beta1.rs");
}
}
pub mod reflection {
pub mod v1beta1 {
include!("prost/cosmos.base.reflection.v1beta1.rs");
}
}
pub mod simulate {
pub mod v1beta1 {
include!("prost/cosmos.base.simulate.v1beta1.rs");
}
}
pub mod store {
pub mod v1beta1 {
include!("prost/cosmos.base.store.v1beta1.rs");
}
}
}
pub mod tx {
pub mod v1beta1 {
Expand All @@ -41,46 +67,41 @@ mod cosmos {
}
}

mod ibc {
pub mod ibc {
pub mod client {
#![allow(missing_docs)]
include!("prost/ibc.client.rs");
}
pub mod channel {
#![allow(missing_docs)]
include!("prost/ibc.channel.rs");
}
pub mod commitment {
#![allow(missing_docs)]
include!("prost/ibc.commitment.rs");
}
pub mod connection {
#![allow(missing_docs)]
include!("prost/ibc.connection.rs");
}
pub mod localhost {
#![allow(missing_docs)]
include!("prost/ibc.localhost.rs");
}
pub mod tendermint {
#![allow(missing_docs)]
include!("prost/ibc.tendermint.rs");
}
pub mod transfer {
#![allow(missing_docs)]
include!("prost/ibc.transfer.rs");
}
pub mod types {
#![allow(missing_docs)]
include!("prost/ibc.types.rs");
}
}

mod ics23 {
pub mod ics23 {
include!("prost/ics23.rs");
}

mod tendermint {
pub mod tendermint {
pub mod abci {
include!("prost/tendermint.abci.rs");
}
pub mod crypto {
include!("prost/tendermint.crypto.rs");
}
Expand All @@ -96,5 +117,3 @@ mod tendermint {
include!("prost/tendermint.version.rs");
}
}

pub use ibc::*;
121 changes: 121 additions & 0 deletions ibc_proto/src/prost/cosmos.base.abci.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/// TxResponse defines a structure containing relevant tx data and metadata. The
/// tags are stringified and the log is JSON decoded.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxResponse {
/// The block height
#[prost(int64, tag="1")]
pub height: i64,
/// The transaction hash.
#[prost(string, tag="2")]
pub txhash: std::string::String,
/// Namespace for the Code
#[prost(string, tag="3")]
pub codespace: std::string::String,
/// Response code.
#[prost(uint32, tag="4")]
pub code: u32,
/// Result bytes, if any.
#[prost(string, tag="5")]
pub data: std::string::String,
/// The output of the application's logger (raw string). May be non-deterministic.
#[prost(string, tag="6")]
pub raw_log: std::string::String,
/// The output of the application's logger (typed). May be non-deterministic.
#[prost(message, repeated, tag="7")]
pub logs: ::std::vec::Vec<AbciMessageLog>,
/// Additional information. May be non-deterministic.
#[prost(string, tag="8")]
pub info: std::string::String,
/// Amount of gas requested for transaction.
#[prost(int64, tag="9")]
pub gas_wanted: i64,
/// Amount of gas consumed by transaction.
#[prost(int64, tag="10")]
pub gas_used: i64,
/// The request transaction bytes.
#[prost(message, optional, tag="11")]
pub tx: ::std::option::Option<::prost_types::Any>,
/// Time of the previous block. For heights > 1, it's the weighted median of the
/// timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time.
#[prost(string, tag="12")]
pub timestamp: std::string::String,
}
/// ABCIMessageLog defines a structure containing an indexed tx ABCI message log.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbciMessageLog {
#[prost(uint32, tag="1")]
pub msg_index: u32,
#[prost(string, tag="2")]
pub log: std::string::String,
/// Events contains a slice of Event objects that were emitted during some
/// execution.
#[prost(message, repeated, tag="3")]
pub events: ::std::vec::Vec<StringEvent>,
}
/// StringEvent defines en Event object wrapper where all the attributes
/// contain key/value pairs that are strings instead of raw bytes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringEvent {
#[prost(string, tag="1")]
pub r#type: std::string::String,
#[prost(message, repeated, tag="2")]
pub attributes: ::std::vec::Vec<Attribute>,
}
/// Attribute defines an attribute wrapper where the key and value are
/// strings instead of raw bytes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Attribute {
#[prost(string, tag="1")]
pub key: std::string::String,
#[prost(string, tag="2")]
pub value: std::string::String,
}
/// GasInfo defines tx execution gas context.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GasInfo {
/// GasWanted is the maximum units of work we allow this tx to perform.
#[prost(uint64, tag="1")]
pub gas_wanted: u64,
/// GasUsed is the amount of gas actually consumed.
#[prost(uint64, tag="2")]
pub gas_used: u64,
}
/// Result is the union of ResponseFormat and ResponseCheckTx.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Result {
/// Data is any data returned from message or handler execution. It MUST be length
/// prefixed in order to separate data from multiple message executions.
#[prost(bytes, tag="1")]
pub data: std::vec::Vec<u8>,
/// Log contains the log information from message or handler execution.
#[prost(string, tag="2")]
pub log: std::string::String,
/// Events contains a slice of Event objects that were emitted during message or
/// handler execution.
#[prost(message, repeated, tag="3")]
pub events: ::std::vec::Vec<super::super::super::super::tendermint::abci::Event>,
}
/// SimulationResponse defines the response generated when a transaction is
/// successfully simulated.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulationResponse {
#[prost(message, optional, tag="1")]
pub gas_info: ::std::option::Option<GasInfo>,
#[prost(message, optional, tag="2")]
pub result: ::std::option::Option<Result>,
}
/// MsgData defines the data returned in a Result object during message execution.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgData {
#[prost(string, tag="1")]
pub msg_type: std::string::String,
#[prost(bytes, tag="2")]
pub data: std::vec::Vec<u8>,
}
/// TxMsgData defines a list of MsgData. A transaction will have a MsgData object for
/// each message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxMsgData {
#[prost(message, repeated, tag="1")]
pub data: ::std::vec::Vec<MsgData>,
}
14 changes: 14 additions & 0 deletions ibc_proto/src/prost/cosmos.base.kv.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/// Pairs defines a repeated slice of Pair objects.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pairs {
#[prost(message, repeated, tag="1")]
pub pairs: ::std::vec::Vec<Pair>,
}
/// Pair defines a key/value bytes tuple.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Pair {
#[prost(bytes, tag="1")]
pub key: std::vec::Vec<u8>,
#[prost(bytes, tag="2")]
pub value: std::vec::Vec<u8>,
}
24 changes: 24 additions & 0 deletions ibc_proto/src/prost/cosmos.base.reflection.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAllInterfacesRequest {
}
/// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAllInterfacesResponse {
/// interface_names is an array of all the registered interfaces.
#[prost(string, repeated, tag="1")]
pub interface_names: ::std::vec::Vec<std::string::String>,
}
/// ListImplementationsRequest is the request type of the ListImplementations RPC.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListImplementationsRequest {
/// interface_name defines the interface to query the implementations for.
#[prost(string, tag="1")]
pub interface_name: std::string::String,
}
/// ListImplementationsResponse is the response type of the ListImplementations RPC.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListImplementationsResponse {
#[prost(string, repeated, tag="1")]
pub implementation_message_names: ::std::vec::Vec<std::string::String>,
}
19 changes: 19 additions & 0 deletions ibc_proto/src/prost/cosmos.base.simulate.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// SimulateRequest is the request type for the SimulateServiceService.Simulate
/// RPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateRequest {
/// tx is the transaction to simulate.
#[prost(message, optional, tag="1")]
pub tx: ::std::option::Option<super::super::super::tx::v1beta1::Tx>,
}
/// SimulateResponse is the response type for the
/// SimulateServiceService.SimulateRPC method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateResponse {
/// gas_info is the information about gas used in the simulation.
#[prost(message, optional, tag="1")]
pub gas_info: ::std::option::Option<super::super::abci::v1beta1::GasInfo>,
/// result is the result of the simulation.
#[prost(message, optional, tag="2")]
pub result: ::std::option::Option<super::super::abci::v1beta1::Result>,
}
27 changes: 27 additions & 0 deletions ibc_proto/src/prost/cosmos.base.store.v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/// CommitInfo defines commit information used by the multi-store when committing
/// a version/height.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitInfo {
#[prost(int64, tag="1")]
pub version: i64,
#[prost(message, repeated, tag="2")]
pub store_infos: ::std::vec::Vec<StoreInfo>,
}
/// StoreInfo defines store-specific commit information. It contains a reference
/// between a store name and the commit ID.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StoreInfo {
#[prost(string, tag="1")]
pub name: std::string::String,
#[prost(message, optional, tag="2")]
pub commit_id: ::std::option::Option<CommitId>,
}
/// CommitID defines the committment information when a specific store is
/// committed.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CommitId {
#[prost(int64, tag="1")]
pub version: i64,
#[prost(bytes, tag="2")]
pub hash: std::vec::Vec<u8>,
}
Loading