Skip to content

Commit e920df5

Browse files
authored
chore(deps): alloy 0.12 (#43)
* chore(deps): alloy 0.2 * bump primitives * 0.12 * nit
1 parent 8b06850 commit e920df5

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

Cargo.toml

+11-6
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ all-features = true
2525
rustdoc-args = ["--cfg", "docsrs"]
2626

2727
[dependencies]
28-
alloy-primitives = { version = "0.8.5", features = ["map"] }
29-
alloy-provider = { version = "0.11", default-features = false }
30-
alloy-rpc-types = { version = "0.11", features = ["eth"] }
31-
alloy-serde = { version = "0.11", default-features = false }
32-
alloy-consensus = { version = "0.11", default-features = false }
28+
alloy-primitives = { version = "0.8.22", features = ["map"] }
29+
alloy-provider = { version = "0.12", default-features = false }
30+
alloy-rpc-types = { version = "0.12", features = ["eth"] }
31+
alloy-consensus = { version = "0.12", default-features = false }
3332

3433
eyre = "0.6"
3534
futures = "0.3"
@@ -51,5 +50,11 @@ tracing = "0.1"
5150
url = "2"
5251

5352
[dev-dependencies]
54-
alloy-rpc-client = "0.11"
53+
alloy-rpc-client = "0.12"
5554
tiny_http = "0.12"
55+
56+
# [patch.crates-io]
57+
# alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "a4e7099" }
58+
# alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "a4e7099" }
59+
# alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "a4e7099" }
60+
# alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "a4e7099" }

src/backend.rs

+8-17
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ use crate::{
66
};
77
use alloy_primitives::{keccak256, Address, Bytes, B256, U256};
88
use alloy_provider::{
9-
network::{AnyNetwork, AnyRpcBlock, AnyRpcTransaction, AnyTxEnvelope},
9+
network::{AnyNetwork, AnyRpcBlock, AnyRpcTransaction},
1010
Provider,
1111
};
12-
use alloy_rpc_types::{BlockId, Transaction};
13-
use alloy_serde::WithOtherFields;
12+
use alloy_rpc_types::BlockId;
1413
use eyre::WrapErr;
1514
use futures::{
1615
channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender},
@@ -311,7 +310,8 @@ where
311310
let provider = self.provider.clone();
312311
let fut = Box::pin(async move {
313312
let block = provider
314-
.get_block(number, true.into())
313+
.get_block(number)
314+
.full()
315315
.await
316316
.wrap_err(format!("could not fetch block {number:?}"));
317317
(sender, block, number)
@@ -349,10 +349,8 @@ where
349349
let provider = self.provider.clone();
350350
let fut = Box::pin(async move {
351351
let block = provider
352-
.get_block_by_number(
353-
number.into(),
354-
alloy_rpc_types::BlockTransactionsKind::Hashes,
355-
)
352+
.get_block_by_number(number.into())
353+
.hashes()
356354
.await
357355
.wrap_err("failed to get block");
358356

@@ -720,10 +718,7 @@ impl SharedBackend {
720718
}
721719

722720
/// Returns the transaction for the hash
723-
pub fn get_transaction(
724-
&self,
725-
tx: B256,
726-
) -> DatabaseResult<WithOtherFields<Transaction<AnyTxEnvelope>>> {
721+
pub fn get_transaction(&self, tx: B256) -> DatabaseResult<AnyRpcTransaction> {
727722
self.blocking_mode.run(|| {
728723
let (sender, rx) = oneshot_channel();
729724
let req = BackendRequest::Transaction(tx, sender);
@@ -922,11 +917,7 @@ mod tests {
922917
let Some(endpoint) = ENDPOINT else { return };
923918
let provider = get_http_provider(endpoint);
924919

925-
let any_rpc_block = provider
926-
.get_block(BlockId::latest(), alloy_rpc_types::BlockTransactionsKind::Hashes)
927-
.await
928-
.unwrap()
929-
.unwrap();
920+
let any_rpc_block = provider.get_block(BlockId::latest()).hashes().await.unwrap().unwrap();
930921
let _meta = BlockchainDbMeta::default().with_block(&any_rpc_block.inner);
931922
}
932923

0 commit comments

Comments
 (0)