From d5db5007304fe10fbdea553ce9cd07b5567341a8 Mon Sep 17 00:00:00 2001 From: Janito Vaqueiro Ferreira Filho Date: Tue, 26 Apr 2022 14:48:49 +0000 Subject: [PATCH] Rename `rpc` module into `wallet_grpc` Avoid any potential misunderstandings when the name is seen out of context. --- zebrad/tests/common/lightwalletd.rs | 2 +- .../common/lightwalletd/send_transaction_test.rs | 11 ++++------- .../common/lightwalletd/{rpc.rs => wallet_grpc.rs} | 6 ++---- 3 files changed, 7 insertions(+), 12 deletions(-) rename zebrad/tests/common/lightwalletd/{rpc.rs => wallet_grpc.rs} (92%) diff --git a/zebrad/tests/common/lightwalletd.rs b/zebrad/tests/common/lightwalletd.rs index 15c0c135234..a53bfd8ebb8 100644 --- a/zebrad/tests/common/lightwalletd.rs +++ b/zebrad/tests/common/lightwalletd.rs @@ -16,8 +16,8 @@ use zebrad::config::ZebradConfig; use super::{config::default_test_config, launch::ZebradTestDirExt}; -pub mod rpc; pub mod send_transaction_test; +pub mod wallet_grpc; /// The name of the env var that enables Zebra lightwalletd integration tests. /// These tests need a `lightwalletd` binary in the test machine's path. diff --git a/zebrad/tests/common/lightwalletd/send_transaction_test.rs b/zebrad/tests/common/lightwalletd/send_transaction_test.rs index c9926f550b0..7154691858c 100644 --- a/zebrad/tests/common/lightwalletd/send_transaction_test.rs +++ b/zebrad/tests/common/lightwalletd/send_transaction_test.rs @@ -35,8 +35,7 @@ use crate::common::{ }, launch::spawn_zebrad_for_rpc_without_initial_peers, lightwalletd::{ - self, - rpc::{connect_to_lightwalletd, spawn_lightwalletd_with_rpc_server}, + wallet_grpc::{self, connect_to_lightwalletd, spawn_lightwalletd_with_rpc_server}, zebra_skip_lightwalletd_tests, LIGHTWALLETD_TEST_TIMEOUT, }, sync::perform_full_sync_starting_from, @@ -79,7 +78,7 @@ pub async fn run() -> Result<()> { let mut rpc_client = connect_to_lightwalletd(lightwalletd_rpc_port).await?; for transaction in transactions { - let expected_response = lightwalletd::rpc::SendResponse { + let expected_response = wallet_grpc::SendResponse { error_code: 0, error_message: format!("\"{}\"", transaction.hash()), }; @@ -212,12 +211,10 @@ where } /// Prepare a request to send to lightwalletd that contains a transaction to be sent. -fn prepare_send_transaction_request( - transaction: Arc, -) -> lightwalletd::rpc::RawTransaction { +fn prepare_send_transaction_request(transaction: Arc) -> wallet_grpc::RawTransaction { let transaction_bytes = transaction.zcash_serialize_to_vec().unwrap(); - lightwalletd::rpc::RawTransaction { + wallet_grpc::RawTransaction { data: transaction_bytes, height: -1, } diff --git a/zebrad/tests/common/lightwalletd/rpc.rs b/zebrad/tests/common/lightwalletd/wallet_grpc.rs similarity index 92% rename from zebrad/tests/common/lightwalletd/rpc.rs rename to zebrad/tests/common/lightwalletd/wallet_grpc.rs index fb1969c7645..1c9b6c9b9d7 100644 --- a/zebrad/tests/common/lightwalletd/rpc.rs +++ b/zebrad/tests/common/lightwalletd/wallet_grpc.rs @@ -9,7 +9,7 @@ use zebra_test::{args, net::random_known_port, prelude::*}; use crate::{ common::{ config::testdir, - lightwalletd::{self, LightWalletdTestDirExt, LIGHTWALLETD_TEST_TIMEOUT}, + lightwalletd::{LightWalletdTestDirExt, LIGHTWALLETD_TEST_TIMEOUT}, }, LIGHTWALLETD_FAILURE_MESSAGES, LIGHTWALLETD_IGNORE_MESSAGES, PROCESS_FAILURE_MESSAGES, }; @@ -24,9 +24,7 @@ const LIGHTWALLETD_DATA_DIR_VAR: &str = "LIGHTWALLETD_DATA_DIR"; /// Type alias for the RPC client to communicate with a lightwalletd instance. pub type LightwalletdRpcClient = - lightwalletd::rpc::compact_tx_streamer_client::CompactTxStreamerClient< - tonic::transport::Channel, - >; + compact_tx_streamer_client::CompactTxStreamerClient; /// Start a lightwalletd instance with its RPC server functionality enabled. ///