Skip to content

Commit

Permalink
fix: alloy types
Browse files Browse the repository at this point in the history
  • Loading branch information
refcell committed Apr 30, 2024
1 parent b74dcbb commit d0bcf19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/engine/payload.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use alloy_consensus::TxEnvelope;
use alloy_eips::eip2718::Encodable2718;
use alloy_rlp::Encodable;
use alloy_rpc_types::Block as AlloyBlock;
use alloy_rpc_types::BlockTransactions;
use ethers::types::{Block, Bytes, Transaction, H160, H256, U64};
Expand Down Expand Up @@ -68,7 +67,7 @@ impl TryFrom<AlloyBlock> for ExecutionPayload {
let encoded_txs = (txs
.into_iter()
.map(|tx| {
let envelope = TxEnvelope::from(tx);
let envelope: TxEnvelope = tx.try_into().unwrap();
let encoded = envelope.encoded_2718();
RawTransaction(encoded.to_vec())
})
Expand Down
7 changes: 2 additions & 5 deletions src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ impl RpcServer for RpcServerImpl {
async fn output_at_block(&self, block_number: u64) -> Result<OutputRootResponse, Error> {
let url = reqwest::Url::parse(&self.config.l2_rpc_url)
.map_err(|err| Error::Custom(format!("unable to parse l2_rpc_url: {err}")))?;
let l2_provider = ProviderBuilder::new()
.on_http(url)
.map_err(|err| Error::Custom(format!("unable to create provider: {err}")))?;
let l2_provider = ProviderBuilder::new().on_http(url);

let block = convert_err(
l2_provider
Expand All @@ -69,14 +67,13 @@ impl RpcServer for RpcServerImpl {
.hash
.ok_or(Error::Custom("block hash not found".to_string()))?;
let locations = vec![];
let block_id = Some(BlockId::from(block_hash));

let state_proof = convert_err(
l2_provider
.get_proof(
self.config.chain.l2_to_l1_message_passer,
locations,
block_id,
BlockId::from(block_hash),
)
.await,
)?;
Expand Down

0 comments on commit d0bcf19

Please sign in to comment.