Skip to content

Commit da84dfc

Browse files
authored
Merge pull request #279 from LNSD/lnsd/chore-deps-use-thegraph-core
chore(deps): use thegraph-core's re-exported alloy dependency
2 parents ffcca1e + 291a117 commit da84dfc

39 files changed

+104
-89
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ license = "Apache-2.0"
1616
repository = "https://github.com/semiotic-ai/timeline-aggregation-protocol"
1717

1818
[workspace.dependencies]
19-
alloy = { version = "0.11.0", features = ["full"] }
2019
serde = { version = "1.0.217", features = ["derive"] }
2120
rstest = "0.24.0"
2221
anyhow = { version = "1.0.95" }
@@ -25,4 +24,5 @@ rand = "0.8.5"
2524
jsonrpsee = { version = "0.24.7", features = ["macros", "server"] }
2625
insta = { version = "1.42.0", features = ["json"] }
2726
serde_json = { version = "1.0.137", features = ["raw_value"] }
27+
thegraph-core = "0.12.0"
2828
thiserror = "2.0.11"

tap_aggregator/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ name = "tap_aggregator"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
alloy.workspace = true
16-
alloy-sol-types ={ version = "0.8.21", features = ["eip712-serde"]}
1715
anyhow.workspace = true
1816
axum = { version = "0.7.5", features = [
1917
"http1",
@@ -36,6 +34,7 @@ serde.workspace = true
3634
serde_json.workspace = true
3735
strum = { version = "0.26.3", features = ["derive"] }
3836
tap_core = { path = "../tap_core", version = "3.0.1" }
37+
thegraph-core = { workspace = true, features = ["alloy-eip712"] }
3938
tokio.workspace = true
4039
tonic = { version = "0.12.3", features = ["transport", "zstd"] }
4140
tower = { version = "0.5.2", features = ["util", "steer"] }

tap_aggregator/src/aggregator/v1.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
use std::collections::{hash_set, HashSet};
55

6-
use alloy::{
7-
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
8-
sol_types::SolStruct,
9-
};
106
use anyhow::{bail, Ok, Result};
117
use rayon::prelude::*;
128
use tap_core::signed_message::{Eip712SignedMessage, SignatureBytes, SignatureBytesExt};
139
use tap_graph::{Receipt, ReceiptAggregateVoucher};
10+
use thegraph_core::alloy::{
11+
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
12+
sol_types::SolStruct,
13+
};
1414

1515
pub fn check_and_aggregate_receipts(
1616
domain_separator: &Eip712Domain,
@@ -132,10 +132,12 @@ fn check_receipt_timestamps(
132132
mod tests {
133133
use std::str::FromStr;
134134

135-
use alloy::{dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner};
136135
use rstest::*;
137136
use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
138137
use tap_graph::{Receipt, ReceiptAggregateVoucher};
138+
use thegraph_core::alloy::{
139+
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
140+
};
139141

140142
use super::*;
141143

tap_aggregator/src/aggregator/v2.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
use std::collections::{hash_set, HashSet};
55

6-
use alloy::{
7-
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
8-
sol_types::SolStruct,
9-
};
106
use anyhow::{bail, Ok, Result};
117
use rayon::prelude::*;
128
use tap_core::signed_message::{Eip712SignedMessage, SignatureBytes, SignatureBytesExt};
139
use tap_graph::v2::{Receipt, ReceiptAggregateVoucher};
10+
use thegraph_core::alloy::{
11+
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
12+
sol_types::SolStruct,
13+
};
1414

1515
pub fn check_and_aggregate_receipts(
1616
domain_separator: &Eip712Domain,
@@ -185,14 +185,14 @@ fn check_receipt_timestamps(
185185

186186
#[cfg(test)]
187187
mod tests {
188-
use alloy::{
188+
use rstest::*;
189+
use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
190+
use tap_graph::v2::{Receipt, ReceiptAggregateVoucher};
191+
use thegraph_core::alloy::{
189192
dyn_abi::Eip712Domain,
190193
primitives::{address, Address, Bytes},
191194
signers::local::PrivateKeySigner,
192195
};
193-
use rstest::*;
194-
use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
195-
use tap_graph::v2::{Receipt, ReceiptAggregateVoucher};
196196

197197
#[fixture]
198198
fn keys() -> (PrivateKeySigner, Address) {

tap_aggregator/src/grpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ pub mod v1 {
141141
}
142142

143143
pub mod v2 {
144-
use alloy::primitives::Bytes;
145144
use anyhow::anyhow;
146145
use tap_core::signed_message::Eip712SignedMessage;
146+
use thegraph_core::alloy::primitives::Bytes;
147147

148148
tonic::include_proto!("tap_aggregator.v2");
149149

tap_aggregator/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
use std::{collections::HashSet, str::FromStr};
77

8-
use alloy::{dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner};
98
use anyhow::Result;
109
use clap::Parser;
1110
use log::{debug, info};
1211
use tap_aggregator::{metrics, server};
1312
use tap_core::tap_eip712_domain;
13+
use thegraph_core::alloy::{
14+
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
15+
};
1416

1517
#[derive(Parser, Debug)]
1618
#[command(author, version, about, long_about = None)]
@@ -141,7 +143,7 @@ async fn main() -> Result<()> {
141143
}
142144

143145
fn create_eip712_domain(args: &Args) -> Result<Eip712Domain> {
144-
// Transfrom the args into the types expected by Eip712Domain::new().
146+
// Transform the args into the types expected by Eip712Domain::new().
145147

146148
// Transform optional strings into optional Cow<str>.
147149
// Transform optional strings into optional U256.

tap_aggregator/src/server.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
use std::{collections::HashSet, str::FromStr};
55

6-
use alloy::{dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner};
76
use anyhow::Result;
87
use axum::{error_handling::HandleError, routing::post_service, BoxError, Router};
98
use hyper::StatusCode;
@@ -16,6 +15,9 @@ use log::{error, info};
1615
use prometheus::{register_counter, register_int_counter, Counter, IntCounter};
1716
use tap_core::signed_message::Eip712SignedMessage;
1817
use tap_graph::{Receipt, ReceiptAggregateVoucher, SignedReceipt};
18+
use thegraph_core::alloy::{
19+
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
20+
};
1921
use tokio::{net::TcpListener, signal, task::JoinHandle};
2022
use tonic::{codec::CompressionEncoding, service::Routes, Request, Response, Status};
2123
use tower::{layer::util::Identity, make::Shared};
@@ -493,12 +495,14 @@ fn produce_kafka_records(
493495
mod tests {
494496
use std::{collections::HashSet, str::FromStr};
495497

496-
use alloy::{dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner};
497498
use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params};
498499
use rand::{prelude::*, seq::SliceRandom};
499500
use rstest::*;
500501
use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
501502
use tap_graph::{Receipt, ReceiptAggregateVoucher};
503+
use thegraph_core::alloy::{
504+
dyn_abi::Eip712Domain, primitives::Address, signers::local::PrivateKeySigner,
505+
};
502506

503507
use crate::server;
504508

tap_aggregator/tests/aggregate_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
use std::{collections::HashSet, str::FromStr};
55

6-
use alloy::{primitives::Address, signers::local::PrivateKeySigner};
76
use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params};
87
use tap_aggregator::{
98
grpc::v1::{tap_aggregator_client::TapAggregatorClient, RavRequest},
@@ -12,6 +11,7 @@ use tap_aggregator::{
1211
};
1312
use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
1413
use tap_graph::{Receipt, ReceiptAggregateVoucher};
14+
use thegraph_core::alloy::{primitives::Address, signers::local::PrivateKeySigner};
1515
use tonic::codec::CompressionEncoding;
1616

1717
#[tokio::test]

tap_aggregator/tests/aggregate_v1_and_v2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
use std::collections::HashSet;
55

6-
use alloy::{
7-
primitives::{address, Address},
8-
signers::local::PrivateKeySigner,
9-
};
106
use tap_aggregator::{
117
grpc::{
128
v1::{tap_aggregator_client::TapAggregatorClient as ClientV1, RavRequest as ReqV1},
@@ -16,6 +12,10 @@ use tap_aggregator::{
1612
};
1713
use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
1814
use tap_graph::{v2::Receipt as ReceiptV2, Receipt as ReceiptV1};
15+
use thegraph_core::alloy::{
16+
primitives::{address, Address},
17+
signers::local::PrivateKeySigner,
18+
};
1919
use tonic::codec::CompressionEncoding;
2020

2121
#[tokio::test]

tap_core/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ readme = "README.md"
88
description = "Core Timeline Aggregation Protocol library: a fast, efficient and trustless unidirectional micro-payments system."
99

1010
[dependencies]
11-
alloy.workspace = true
1211
anyhow.workspace = true
1312
async-trait = "0.1.85"
1413
rand.workspace = true
15-
thiserror.workspace = true
16-
tokio.workspace = true
17-
tap_receipt = { version = "0.1.0", path = "../tap_receipt" }
1814
tap_eip712_message = { version = "0.1.0", path = "../tap_eip712_message" }
1915
tap_graph = { version = "0.2.0", path = "../tap_graph", optional = true }
16+
tap_receipt = { version = "0.1.0", path = "../tap_receipt" }
17+
thegraph-core.workspace = true
18+
thiserror.workspace = true
19+
tokio.workspace = true
2020

2121
[dev-dependencies]
2222
criterion = { version = "0.5.1", features = ["async_std"] }
2323
insta.workspace = true
2424
rstest.workspace = true
2525
serde_json.workspace = true
26+
thegraph-core = { workspace = true, features = ["alloy-signer-mnemonic"] }
2627

2728
[features]
2829
default = ["in_memory"]

0 commit comments

Comments
 (0)