Skip to content

Commit 2a0bf49

Browse files
authored
Merge pull request #216 from semiotic-ai/gusinacio/new-project-structure
Refactor: new project structure
2 parents 59154df + 351cf45 commit 2a0bf49

35 files changed

+853
-1090
lines changed

tap_aggregator/src/aggregator.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use ethers_core::types::Signature;
1010
use ethers_signers::LocalWallet;
1111

1212
use tap_core::{
13-
eip_712_signed_message::EIP712SignedMessage,
14-
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_receipt::Receipt,
13+
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
1514
};
1615

1716
pub fn check_and_aggregate_receipts(
@@ -140,9 +139,7 @@ mod tests {
140139
use rstest::*;
141140

142141
use crate::aggregator;
143-
use tap_core::{
144-
eip_712_signed_message::EIP712SignedMessage, tap_eip712_domain, tap_receipt::Receipt,
145-
};
142+
use tap_core::{receipt::Receipt, signed_message::EIP712SignedMessage, tap_eip712_domain};
146143

147144
#[fixture]
148145
fn keys() -> (LocalWallet, Address) {
@@ -248,7 +245,7 @@ mod tests {
248245
// Create rav with max_timestamp below the receipts timestamps
249246
let rav = EIP712SignedMessage::new(
250247
&domain_separator,
251-
tap_core::receipt_aggregate_voucher::ReceiptAggregateVoucher {
248+
tap_core::rav::ReceiptAggregateVoucher {
252249
allocationId: allocation_ids[0],
253250
timestampNs: receipt_timestamp_range.clone().min().unwrap() - 1,
254251
valueAggregate: 42,
@@ -262,7 +259,7 @@ mod tests {
262259
// Aggregation should fail
263260
let rav = EIP712SignedMessage::new(
264261
&domain_separator,
265-
tap_core::receipt_aggregate_voucher::ReceiptAggregateVoucher {
262+
tap_core::rav::ReceiptAggregateVoucher {
266263
allocationId: allocation_ids[0],
267264
timestampNs: receipt_timestamp_range.clone().min().unwrap(),
268265
valueAggregate: 42,
@@ -276,7 +273,7 @@ mod tests {
276273
// Aggregation should fail
277274
let rav = EIP712SignedMessage::new(
278275
&domain_separator,
279-
tap_core::receipt_aggregate_voucher::ReceiptAggregateVoucher {
276+
tap_core::rav::ReceiptAggregateVoucher {
280277
allocationId: allocation_ids[0],
281278
timestampNs: receipt_timestamp_range.clone().max().unwrap() + 1,
282279
valueAggregate: 42,

tap_aggregator/src/server.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ use crate::api_versioning::{
1919
use crate::error_codes::{JsonRpcErrorCode, JsonRpcWarningCode};
2020
use crate::jsonrpsee_helpers::{JsonRpcError, JsonRpcResponse, JsonRpcResult, JsonRpcWarning};
2121
use tap_core::{
22-
eip_712_signed_message::EIP712SignedMessage,
23-
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_receipt::Receipt,
22+
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
2423
};
2524

2625
// Register the metrics into the global metrics registry.
@@ -254,9 +253,8 @@ mod tests {
254253

255254
use crate::server;
256255
use tap_core::{
257-
eip_712_signed_message::EIP712SignedMessage,
258-
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_eip712_domain,
259-
tap_receipt::Receipt,
256+
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
257+
tap_eip712_domain,
260258
};
261259

262260
#[derive(Clone)]

tap_core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ criterion = { version = "0.5", features = ["async_std"] }
3030

3131

3232
[features]
33-
default = ["mock"]
34-
mock = []
33+
default = ["in_memory"]
34+
in_memory = []
3535

3636
[[bench]]
3737
name = 'timeline_aggretion_protocol_benchmark'

tap_core/benches/timeline_aggretion_protocol_benchmark.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ use ethers_core::k256::ecdsa::SigningKey;
1818
use rand_core::OsRng;
1919
use tap_core::tap_eip712_domain;
2020
use tap_core::{
21-
eip_712_signed_message::EIP712SignedMessage,
22-
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_receipt::Receipt,
21+
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
2322
};
2423

2524
pub fn create_and_sign_receipt(

tap_core/src/adapters/test/escrow_adapter_test.rs

Lines changed: 0 additions & 84 deletions
This file was deleted.

tap_core/src/adapters/test/mod.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

tap_core/src/adapters/test/rav_storage_adapter_test.rs

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)