Skip to content

Commit

Permalink
Make imports conditional on a feature
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 committed Jan 16, 2023
1 parent dc3f2fc commit 8c51e13
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zebrad/tests/common/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
use std::net::SocketAddr;

use color_eyre::{eyre::eyre, Result};
use jsonrpc_core::Output;
use reqwest::Client;

#[cfg(feature = "getblocktemplate-rpcs")]
use color_eyre::{eyre::eyre, Result};

/// An http client for making Json-RPC requests
pub struct RPCRequestClient {
client: Client,
Expand Down Expand Up @@ -67,6 +68,8 @@ impl RPCRequestClient {
fn json_result_from_response_text<T: serde::de::DeserializeOwned>(
response_text: &str,
) -> Result<T> {
use jsonrpc_core::Output;

let output: Output = serde_json::from_str(response_text)?;
match output {
Output::Success(success) => Ok(serde_json::from_value(success.result)?),
Expand Down

0 comments on commit 8c51e13

Please sign in to comment.