Skip to content

Commit

Permalink
Add proto descriptor binary (#115)
Browse files Browse the repository at this point in the history
* compile proto descriptor

* proto descriptor binary

* include proto descriptor
  • Loading branch information
rnbguy authored Jul 12, 2023
1 parent 9e87819 commit e8b6d0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ json-schema = ["std", "schemars"]
server = ["std", "tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
parity-scale-codec = ["dep:parity-scale-codec", "dep:scale-info"]
borsh = ["dep:borsh"]
proto-descriptor = []
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ pub const COSMOS_SDK_COMMIT: &str = include_str!("COSMOS_SDK_COMMIT");
/// The version (commit hash) of IBC Go used when generating this library.
pub const IBC_GO_COMMIT: &str = include_str!("IBC_GO_COMMIT");

/// File descriptor set of compiled proto.
#[cfg(feature = "proto-descriptor")]
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("prost/proto_descriptor.bin");

pub mod cosmos {
pub mod auth {
pub mod v1beta1 {
Expand Down
Binary file added src/prost/proto_descriptor.bin
Binary file not shown.
1 change: 1 addition & 0 deletions tools/proto-compiler/src/cmd/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ impl CompileCmd {
.build_server(true)
.server_mod_attribute(".", r#"#[cfg(feature = "server")]"#)
.out_dir(out_dir)
.file_descriptor_set_path(out_dir.join("proto_descriptor.bin"))
.extern_path(".tendermint", "::tendermint_proto")
.extern_path(".ics23", "::ics23")
.type_attribute(".google.protobuf.Any", attrs_serde)
Expand Down

0 comments on commit e8b6d0e

Please sign in to comment.