From f3040377c9bfb3b010fb5f311d2f2aff81e1ba52 Mon Sep 17 00:00:00 2001 From: Noah Citron Date: Sun, 21 Aug 2022 12:27:19 -0400 Subject: [PATCH] rename execution_rpc submodule to rpc --- src/execution/execution.rs | 10 +++++----- src/execution/mod.rs | 2 +- src/execution/{execution_rpc.rs => rpc.rs} | 8 +++----- 3 files changed, 9 insertions(+), 11 deletions(-) rename src/execution/{execution_rpc.rs => rpc.rs} (84%) diff --git a/src/execution/execution.rs b/src/execution/execution.rs index b7983d3..6a2a93f 100644 --- a/src/execution/execution.rs +++ b/src/execution/execution.rs @@ -4,21 +4,21 @@ use eyre::Result; use crate::consensus::types::ExecutionPayload; use super::proof::{encode_account, verify_proof}; -use super::execution_rpc::ExecutionRpc; +use super::rpc::Rpc; pub struct ExecutionClient { - execution_rpc: ExecutionRpc, + rpc: Rpc, } impl ExecutionClient { pub fn new(rpc: &str) -> Self { - let execution_rpc = ExecutionRpc::new(rpc); - ExecutionClient { execution_rpc } + let rpc = Rpc::new(rpc); + ExecutionClient { rpc } } pub async fn get_account(&self, address: &Address, payload: &ExecutionPayload) -> Result { let proof = self - .execution_rpc + .rpc .get_proof(&address, payload.block_number) .await?; diff --git a/src/execution/mod.rs b/src/execution/mod.rs index 1a71be6..06f7a54 100644 --- a/src/execution/mod.rs +++ b/src/execution/mod.rs @@ -3,5 +3,5 @@ pub mod types; mod execution; pub use execution::*; -mod execution_rpc; +mod rpc; mod proof; diff --git a/src/execution/execution_rpc.rs b/src/execution/rpc.rs similarity index 84% rename from src/execution/execution_rpc.rs rename to src/execution/rpc.rs index b57dfd3..48cf375 100644 --- a/src/execution/execution_rpc.rs +++ b/src/execution/rpc.rs @@ -4,15 +4,13 @@ use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_param use super::types::Proof; -pub struct ExecutionRpc { +pub struct Rpc { rpc: String, } -impl ExecutionRpc { +impl Rpc { pub fn new(rpc: &str) -> Self { - ExecutionRpc { - rpc: rpc.to_string(), - } + Rpc { rpc: rpc.to_string() } } pub async fn get_proof(&self, address: &Address, block: u64) -> Result {