Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Ccip read #2374

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ethers-providers/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,33 @@ pub trait Middleware: Sync + Send + Debug {
self.inner().estimate_gas(tx, block).await.map_err(MiddlewareError::from_err)
}

/// Makes a Cross-Chain Interoperability Protocol (CCIP-Read) request
/// and returns the result as `Bytes` or an error message.
async fn ccip_request(
&self,
sender: Address,
tx: &TypedTransaction,
calldata: &[u8],
urls: Vec<&str>,
) -> Result<Bytes, Self::Error> {
self.inner()
.ccip_request(sender, tx, calldata, urls)
.await
.map_err(MiddlewareError::from_err)
}

/// Sends the read-only (constant) transaction to a single Ethereum node and return the result
/// (as bytes) of executing it. This is free, since it does not change any state on the
/// blockchain.
async fn _call(
&self,
tx: &TypedTransaction,
block: Option<BlockId>,
attempt: u8,
) -> Result<Bytes, Self::Error> {
self.inner()._call(tx, block, attempt).await.map_err(MiddlewareError::from_err)
}

/// Sends the read-only (constant) transaction to a single Ethereum node and return the result
/// (as bytes) of executing it. This is free, since it does not change any state on the
/// blockchain.
Expand Down
Loading