Skip to content

Commit

Permalink
Merge pull request #598 from input-output-hk/tonic-0.5
Browse files Browse the repository at this point in the history
Update to tonic 0.5 and prost 0.8
  • Loading branch information
Mikhail Zabaluev committed Jul 13, 2021
2 parents 3a8acda + d532285 commit 11f9e24
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
7 changes: 4 additions & 3 deletions chain-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ license = "MIT OR Apache-2.0"
chain-crypto = { path = "../chain-crypto" }
async-trait = "0.1"
futures = "0.3"
http-body = "0.4"
pin-project = "1.0"
prost = "0.7"
prost = "0.8"
rand_core = "0.6"
thiserror = "1.0"

[dependencies.tonic]
version = "0.4"
version = "0.5"
default-features = false
features = ["codegen", "prost"]

[dev-dependencies]
rand = "0.8"

[build-dependencies.tonic-build]
version = "0.4"
version = "0.5"
default-features = false
features = ["prost"]

Expand Down
19 changes: 11 additions & 8 deletions chain-network/src/grpc/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ use crate::data::{Gossip, HandshakeResponse};
use crate::error::{Error, HandshakeError};
use crate::PROTOCOL_VERSION;
use futures::prelude::*;
use tonic::body::{Body, BoxBody};
use http_body::Body;
use tonic::body::BoxBody;
use tonic::client::GrpcService;
use tonic::codegen::{HttpBody, StdError};
use tonic::codegen::StdError;

#[cfg(feature = "legacy")]
use tonic::metadata::MetadataValue;
Expand All @@ -23,6 +24,7 @@ use tonic::metadata::MetadataValue;
use tonic::transport;

use std::convert::TryFrom;
use std::fmt::Debug;

#[cfg(feature = "transport")]
use std::convert::TryInto;
Expand Down Expand Up @@ -54,9 +56,9 @@ impl Builder {
pub fn build<T>(&self, service: T) -> Client<T>
where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::ResponseBody: Send + Sync + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
Client {
inner: proto::node_client::NodeClient::new(service),
Expand Down Expand Up @@ -110,9 +112,9 @@ impl Client<transport::Channel> {
impl<T> Client<T>
where
T: GrpcService<BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::ResponseBody: Send + Sync + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(service: T) -> Self {
Builder::new().build(service)
Expand All @@ -135,9 +137,10 @@ impl<T> Client<T>
where
T: GrpcService<BoxBody> + Send,
T::Future: Send,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::ResponseBody: Send + Sync + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T: Debug, // https://github.com/hyperium/tonic/issues/718
{
/// Requests the identifier of the genesis block from the service node.
///
Expand Down

0 comments on commit 11f9e24

Please sign in to comment.