Skip to content

Conversation

@gusinacio
Copy link
Contributor

@gusinacio gusinacio commented Jan 17, 2025

This PR:

  • Adds two new generic values to Manager: Rav and SignedReceipt.
  • Adds two traits: WithUniqueId and WithValueAndTimestamp
  • Remove unused code for EscrowHandler
  • Update Check type to be generic over Receipt
  • Update Adapters to be generic over Receipt and Ravs
  • Update ReceiptWithState to be generic over SignedReceipt type
  • Remove AwaitingEscrow receipt state
  • Rename Reserved to Checked receipt state
  • Create Aggregate trait to allow implementation to other types

@gusinacio gusinacio force-pushed the gustavo/generic-manager branch from 28baab5 to 6885d9c Compare January 17, 2025 15:33
@coveralls
Copy link

coveralls commented Jan 17, 2025

Pull Request Test Coverage Report for Build 12915395703

Details

  • 94 of 103 (91.26%) changed or added relevant lines in 10 files are covered.
  • 22 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-2.5%) to 81.008%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tap_core/src/rav.rs 15 18 83.33%
tap_core/src/receipt/receipt_sol.rs 3 6 50.0%
tap_core/src/signed_message.rs 6 9 66.67%
Files with Coverage Reduction New Missed Lines %
tap_core/src/manager/context/memory.rs 22 81.31%
Totals Coverage Status
Change from base Build 12797494651: -2.5%
Covered Lines: 1045
Relevant Lines: 1290

💛 - Coveralls

Signed-off-by: Gustavo Inacio <[email protected]>
@gusinacio gusinacio force-pushed the gustavo/generic-manager branch 2 times, most recently from 54a065d to 07fa2d8 Compare January 22, 2025 19:06
refactor: remove unused escrow handler
Signed-off-by: Gustavo Inacio <[email protected]>
@gusinacio gusinacio force-pushed the gustavo/generic-manager branch from 9ad810d to 44f0afa Compare January 22, 2025 19:13

[dependencies]
tap_core = { path = "../tap_core", version = "2.0.0" }
tap_core = { path = "../tap_core", version = "2.0.0", features = ["test"] }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really liking this feature here in tap_aggregator

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... Why is it required?

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use tap_core::{
rav::ReceiptAggregateVoucher, receipt::Receipt, signed_message::EIP712SignedMessage,
rav::{Aggregate, ReceiptAggregateVoucher},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these benchmarks used?

Comment on lines -41 to +42
received_rav: ReceiptAggregateVoucher,
expected_rav: ReceiptAggregateVoucher,
received_rav: String,
expected_rav: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems strange! This is to allow for basically any generic message? Why not use a newtype?

},

/// Error when the received RAV does not match the expected RAV
#[error("Received RAV does not match expexted RAV")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[error("Received RAV does not match expexted RAV")]
#[error("Received RAV does not match expected RAV")]

Comment on lines +48 to +55
#[cfg(any(test, feature = "test"))]
impl From<crate::receipt::SignedReceipt>
for ReceiptWithState<Checked, crate::receipt::SignedReceipt>
{
fn from(signed_receipt: crate::receipt::SignedReceipt) -> Self {
ReceiptWithState {
signed_receipt,
_state: Checked,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

}
}

let receipts = receipts.into_iter().map(Into::into).collect::<Vec<_>>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No big deal but here is one place I'd like to see what type it's being coerced to 😄

@gusinacio gusinacio closed this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants