Skip to content

Commit 57572f2

Browse files
committed
refactor: rename ReceiptType to NetworkVersion
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent 355b891 commit 57572f2

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

crates/tap-agent/src/agent/sender_allocation.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use crate::{
3939
tap::{
4040
context::{
4141
checks::{AllocationId, Signature},
42-
ReceiptType, TapAgentContext,
42+
NetworkVersion, TapAgentContext,
4343
},
4444
signers_trimmed, TapReceipt,
4545
},
@@ -97,13 +97,13 @@ type TapManager<T> = tap_core::manager::Manager<TapAgentContext<T>, TapReceipt>;
9797

9898
/// Manages unaggregated fees and the TAP lifecyle for a specific (allocation, sender) pair.
9999
pub struct SenderAllocation<T>(PhantomData<T>);
100-
impl<T: ReceiptType> Default for SenderAllocation<T> {
100+
impl<T: NetworkVersion> Default for SenderAllocation<T> {
101101
fn default() -> Self {
102102
Self(PhantomData)
103103
}
104104
}
105105

106-
pub struct SenderAllocationState<T: ReceiptType> {
106+
pub struct SenderAllocationState<T: NetworkVersion> {
107107
unaggregated_fees: UnaggregatedReceipts,
108108
invalid_receipts_fees: UnaggregatedReceipts,
109109
latest_rav: Option<Eip712SignedMessage<T::Rav>>,
@@ -140,7 +140,7 @@ impl AllocationConfig {
140140
}
141141

142142
#[derive(bon::Builder)]
143-
pub struct SenderAllocationArgs<T: ReceiptType> {
143+
pub struct SenderAllocationArgs<T: NetworkVersion> {
144144
pub pgpool: PgPool,
145145
pub allocation_id: Address,
146146
pub sender: Address,
@@ -165,7 +165,7 @@ pub enum SenderAllocationMessage {
165165
#[async_trait::async_trait]
166166
impl<T> Actor for SenderAllocation<T>
167167
where
168-
T: ReceiptType,
168+
T: NetworkVersion,
169169
for<'a> &'a Eip712SignedMessage<T::Rav>: Into<RavInformation>,
170170
TapAgentContext<T>:
171171
RavRead<T::Rav> + RavStore<T::Rav> + ReceiptDelete + ReceiptRead<TapReceipt>,
@@ -351,7 +351,7 @@ where
351351

352352
impl<T> SenderAllocationState<T>
353353
where
354-
T: ReceiptType,
354+
T: NetworkVersion,
355355
TapAgentContext<T>:
356356
RavRead<T::Rav> + RavStore<T::Rav> + ReceiptDelete + ReceiptRead<TapReceipt>,
357357
{

crates/tap-agent/src/tap/context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub use error::AdapterError;
2727
use tonic::{transport::Channel, Code, Status};
2828

2929
#[sealed::sealed]
30-
pub trait ReceiptType: Send + Sync + 'static {
30+
pub trait NetworkVersion: Send + Sync + 'static {
3131
//type Receipt;
3232
type Rav: SolStruct
3333
+ Aggregate<TapReceipt>
@@ -52,7 +52,7 @@ pub enum Legacy {}
5252
pub enum Horizon {}
5353

5454
#[sealed::sealed]
55-
impl ReceiptType for Legacy {
55+
impl NetworkVersion for Legacy {
5656
//type Receipt = tap_graph::Receipt;
5757
type Rav = tap_graph::ReceiptAggregateVoucher;
5858
type AggregatorClient =
@@ -87,7 +87,7 @@ impl ReceiptType for Legacy {
8787
}
8888

8989
#[sealed::sealed]
90-
impl ReceiptType for Horizon {
90+
impl NetworkVersion for Horizon {
9191
//type Receipt = tap_graph::v2::Receipt;
9292
type Rav = tap_graph::v2::ReceiptAggregateVoucher;
9393
type AggregatorClient =
@@ -130,7 +130,7 @@ pub struct TapAgentContext<T> {
130130
_phantom: PhantomData<T>,
131131
}
132132

133-
impl<T: ReceiptType> TapAgentContext<T> {
133+
impl<T: NetworkVersion> TapAgentContext<T> {
134134
pub fn new(
135135
pgpool: PgPool,
136136
allocation_id: Address,

crates/tap-agent/src/tap/context/escrow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use async_trait::async_trait;
55
use tap_core::manager::adapters::SignatureChecker;
66
use thegraph_core::alloy::primitives::Address;
77

8-
use super::{error::AdapterError, ReceiptType, TapAgentContext};
8+
use super::{error::AdapterError, NetworkVersion, TapAgentContext};
99

1010
// Conversion from eventuals::error::Closed to AdapterError::EscrowEventualError
1111
impl From<eventuals::error::Closed> for AdapterError {
@@ -22,7 +22,7 @@ impl From<eventuals::error::Closed> for AdapterError {
2222
// In any case, we don't want to fail a receipt because of this.
2323
// The receipt is fine, just the escrow account that is not.
2424
#[async_trait]
25-
impl<T: ReceiptType + Send + Sync> SignatureChecker for TapAgentContext<T> {
25+
impl<T: NetworkVersion + Send + Sync> SignatureChecker for TapAgentContext<T> {
2626
type AdapterError = AdapterError;
2727

2828
async fn verify_signer(&self, signer: Address) -> Result<bool, Self::AdapterError> {

0 commit comments

Comments
 (0)