Skip to content

Commit

Permalink
cnidarium: create proto module and refresh descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Dec 25, 2024
1 parent a36b2a9 commit fc3bde5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ documentation = "https://docs.rs/cnidarium"
migration = []
migration-proptests = ["migration"]
default = ["metrics"]
rpc = ["dep:tonic", "dep:prost", "dep:serde", "dep:pbjson", "dep:ibc-proto"]
rpc = ["proto"]
proto = ["dep:tonic", "dep:prost", "dep:serde", "dep:pbjson", "dep:ibc-proto"]

[dependencies]
anyhow = "1.0.86"
Expand Down
Binary file modified src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,6 @@ pub mod future;

#[cfg(feature = "rpc")]
pub mod rpc;

#[cfg(feature = "proto")]
pub mod proto;
16 changes: 2 additions & 14 deletions src/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
// Autogen code isn't clippy clean:
#[allow(clippy::unwrap_used)]
pub mod proto {
pub mod v1 {
include!("gen/penumbra.cnidarium.v1.rs");
include!("gen/penumbra.cnidarium.v1.serde.rs");
}

// https://github.com/penumbra-zone/penumbra/issues/3038#issuecomment-1722534133
pub const FILE_DESCRIPTOR_SET: &[u8] = include_bytes!("gen/proto_descriptor.bin.no_lfs");
}

pub struct Server {
storage: Storage,
}
Expand All @@ -21,13 +9,13 @@ impl Server {
}
use std::pin::Pin;

use crate::read::StateRead;
use crate::rpc::proto::v1::{
use crate::proto::v1::{
key_value_response::Value as JMTValue, non_verifiable_key_value_response::Value as NVValue,
query_service_server::QueryService, watch_response as wr, KeyValueRequest, KeyValueResponse,
NonVerifiableKeyValueRequest, NonVerifiableKeyValueResponse, PrefixValueRequest,
PrefixValueResponse, WatchRequest, WatchResponse,
};
use crate::read::StateRead;
use futures::{StreamExt, TryStreamExt};
use regex::Regex;
use tokio_stream::wrappers::ReceiverStream;
Expand Down

0 comments on commit fc3bde5

Please sign in to comment.