rename execution_rpc submodule to rpc
This commit is contained in:
parent
5240385dcd
commit
f3040377c9
|
@ -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<Account> {
|
||||
let proof = self
|
||||
.execution_rpc
|
||||
.rpc
|
||||
.get_proof(&address, payload.block_number)
|
||||
.await?;
|
||||
|
||||
|
|
|
@ -3,5 +3,5 @@ pub mod types;
|
|||
mod execution;
|
||||
pub use execution::*;
|
||||
|
||||
mod execution_rpc;
|
||||
mod rpc;
|
||||
mod proof;
|
||||
|
|
|
@ -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<Proof> {
|
Loading…
Reference in New Issue