From 891362a71012ac01905f5d8518aa95cdade47751 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Fri, 28 Jun 2024 16:01:34 -0400 Subject: [PATCH] Correct invalid RPC type def in monero-rpc --- coins/monero/rpc/src/lib.rs | 12 ++++++------ .../monero/wallet/tests/{runner.rs => runner/mod.rs} | 0 2 files changed, 6 insertions(+), 6 deletions(-) rename coins/monero/wallet/tests/{runner.rs => runner/mod.rs} (100%) diff --git a/coins/monero/rpc/src/lib.rs b/coins/monero/rpc/src/lib.rs index 66d6ab26..8af6ee99 100644 --- a/coins/monero/rpc/src/lib.rs +++ b/coins/monero/rpc/src/lib.rs @@ -261,7 +261,7 @@ pub trait Rpc: Sync + Clone + Debug { let res_str = std_shims::str::from_utf8(&res) .map_err(|_| RpcError::InvalidNode("response wasn't utf-8".to_string()))?; serde_json::from_str(res_str) - .map_err(|_| RpcError::InvalidNode(format!("response wasn't json: {res_str}"))) + .map_err(|_| RpcError::InvalidNode(format!("response wasn't the expected json: {res_str}"))) } /// Perform a JSON-RPC call with the specified method with the provided parameters. @@ -285,15 +285,15 @@ pub trait Rpc: Sync + Clone + Debug { /// Get the active blockchain protocol version. /// /// This is specifically the major version within the most recent block header. - async fn get_protocol(&self) -> Result { + async fn get_hardfork_version(&self) -> Result { #[derive(Deserialize, Debug)] - struct ProtocolResponse { - hardfork_version: u8, + struct HeaderResponse { + major_version: u8, } #[derive(Deserialize, Debug)] struct LastHeaderResponse { - block_header: ProtocolResponse, + block_header: HeaderResponse, } Ok( @@ -301,7 +301,7 @@ pub trait Rpc: Sync + Clone + Debug { .json_rpc_call::("get_last_block_header", None) .await? .block_header - .hardfork_version, + .major_version, ) } diff --git a/coins/monero/wallet/tests/runner.rs b/coins/monero/wallet/tests/runner/mod.rs similarity index 100% rename from coins/monero/wallet/tests/runner.rs rename to coins/monero/wallet/tests/runner/mod.rs