Skip to content

Commit

Permalink
Merge pull request #216 from semiotic-ai/gusinacio/new-project-structure
Browse files Browse the repository at this point in the history
Refactor: new project structure
  • Loading branch information
gusinacio authored Mar 11, 2024
2 parents 59154df + 351cf45 commit 2a0bf49
Show file tree
Hide file tree
Showing 35 changed files with 853 additions and 1,090 deletions.
13 changes: 5 additions & 8 deletions tap_aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use ethers_core::types::Signature;
use ethers_signers::LocalWallet;

use tap_core::{
eip_712_signed_message::EIP712SignedMessage,
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_receipt::Receipt,
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
};

pub fn check_and_aggregate_receipts(
Expand Down Expand Up @@ -140,9 +139,7 @@ mod tests {
use rstest::*;

use crate::aggregator;
use tap_core::{
eip_712_signed_message::EIP712SignedMessage, tap_eip712_domain, tap_receipt::Receipt,
};
use tap_core::{receipt::Receipt, signed_message::EIP712SignedMessage, tap_eip712_domain};

#[fixture]
fn keys() -> (LocalWallet, Address) {
Expand Down Expand Up @@ -248,7 +245,7 @@ mod tests {
// Create rav with max_timestamp below the receipts timestamps
let rav = EIP712SignedMessage::new(
&domain_separator,
tap_core::receipt_aggregate_voucher::ReceiptAggregateVoucher {
tap_core::rav::ReceiptAggregateVoucher {
allocationId: allocation_ids[0],
timestampNs: receipt_timestamp_range.clone().min().unwrap() - 1,
valueAggregate: 42,
Expand All @@ -262,7 +259,7 @@ mod tests {
// Aggregation should fail
let rav = EIP712SignedMessage::new(
&domain_separator,
tap_core::receipt_aggregate_voucher::ReceiptAggregateVoucher {
tap_core::rav::ReceiptAggregateVoucher {
allocationId: allocation_ids[0],
timestampNs: receipt_timestamp_range.clone().min().unwrap(),
valueAggregate: 42,
Expand All @@ -276,7 +273,7 @@ mod tests {
// Aggregation should fail
let rav = EIP712SignedMessage::new(
&domain_separator,
tap_core::receipt_aggregate_voucher::ReceiptAggregateVoucher {
tap_core::rav::ReceiptAggregateVoucher {
allocationId: allocation_ids[0],
timestampNs: receipt_timestamp_range.clone().max().unwrap() + 1,
valueAggregate: 42,
Expand Down
8 changes: 3 additions & 5 deletions tap_aggregator/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ use crate::api_versioning::{
use crate::error_codes::{JsonRpcErrorCode, JsonRpcWarningCode};
use crate::jsonrpsee_helpers::{JsonRpcError, JsonRpcResponse, JsonRpcResult, JsonRpcWarning};
use tap_core::{
eip_712_signed_message::EIP712SignedMessage,
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_receipt::Receipt,
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
};

// Register the metrics into the global metrics registry.
Expand Down Expand Up @@ -254,9 +253,8 @@ mod tests {

use crate::server;
use tap_core::{
eip_712_signed_message::EIP712SignedMessage,
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_eip712_domain,
tap_receipt::Receipt,
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
tap_eip712_domain,
};

#[derive(Clone)]
Expand Down
4 changes: 2 additions & 2 deletions tap_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ criterion = { version = "0.5", features = ["async_std"] }


[features]
default = ["mock"]
mock = []
default = ["in_memory"]
in_memory = []

[[bench]]
name = 'timeline_aggretion_protocol_benchmark'
Expand Down
3 changes: 1 addition & 2 deletions tap_core/benches/timeline_aggretion_protocol_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ use ethers_core::k256::ecdsa::SigningKey;
use rand_core::OsRng;
use tap_core::tap_eip712_domain;
use tap_core::{
eip_712_signed_message::EIP712SignedMessage,
receipt_aggregate_voucher::ReceiptAggregateVoucher, tap_receipt::Receipt,
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
};

pub fn create_and_sign_receipt(
Expand Down
84 changes: 0 additions & 84 deletions tap_core/src/adapters/test/escrow_adapter_test.rs

This file was deleted.

6 changes: 0 additions & 6 deletions tap_core/src/adapters/test/mod.rs

This file was deleted.

117 changes: 0 additions & 117 deletions tap_core/src/adapters/test/rav_storage_adapter_test.rs

This file was deleted.

Loading

0 comments on commit 2a0bf49

Please sign in to comment.