@@ -18,8 +18,9 @@ use axum::{
1818} ;
1919use tap_core:: {
2020 manager:: { adapters:: ReceiptStore , Manager } ,
21- receipt:: { Context , SignedReceipt } ,
21+ receipt:: Context ,
2222} ;
23+ use tap_graph:: { ReceiptAggregateVoucher , SignedReceipt } ;
2324use tower_http:: auth:: AsyncAuthorizeRequest ;
2425
2526use crate :: { error:: IndexerServiceError , middleware:: prometheus_metrics:: MetricLabels } ;
@@ -30,7 +31,7 @@ use crate::{error::IndexerServiceError, middleware::prometheus_metrics::MetricLa
3031///
3132/// Requires SignedReceipt, MetricLabels and Arc<Context> extensions
3233pub fn tap_receipt_authorize < T , B > (
33- tap_manager : Arc < Manager < T > > ,
34+ tap_manager : Arc < Manager < T , SignedReceipt , ReceiptAggregateVoucher > > ,
3435 failed_receipt_metric : & ' static prometheus:: CounterVec ,
3536) -> impl AsyncAuthorizeRequest <
3637 B ,
@@ -40,7 +41,7 @@ pub fn tap_receipt_authorize<T, B>(
4041> + Clone
4142 + Send
4243where
43- T : ReceiptStore + Sync + Send + ' static ,
44+ T : ReceiptStore < SignedReceipt > + Sync + Send + ' static ,
4445 B : Send ,
4546{
4647 move |request : Request < B > | {
@@ -88,12 +89,9 @@ mod tests {
8889 use sqlx:: PgPool ;
8990 use tap_core:: {
9091 manager:: Manager ,
91- receipt:: {
92- checks:: { Check , CheckError , CheckList , CheckResult } ,
93- state:: Checking ,
94- ReceiptWithState ,
95- } ,
92+ receipt:: checks:: { Check , CheckError , CheckList , CheckResult } ,
9693 } ;
94+ use tap_graph:: SignedReceipt ;
9795 use test_assets:: {
9896 assert_while_retry, create_signed_receipt, SignedReceiptRequest , TAP_EIP712_DOMAIN ,
9997 } ;
@@ -105,7 +103,7 @@ mod tests {
105103 auth:: tap_receipt_authorize,
106104 prometheus_metrics:: { MetricLabelProvider , MetricLabels } ,
107105 } ,
108- tap:: IndexerTapContext ,
106+ tap:: { CheckingReceipt , IndexerTapContext } ,
109107 } ;
110108
111109 #[ fixture]
@@ -133,11 +131,11 @@ mod tests {
133131
134132 struct MyCheck ;
135133 #[ async_trait:: async_trait]
136- impl Check for MyCheck {
134+ impl Check < SignedReceipt > for MyCheck {
137135 async fn check (
138136 & self ,
139137 _: & tap_core:: receipt:: Context ,
140- receipt : & ReceiptWithState < Checking > ,
138+ receipt : & CheckingReceipt ,
141139 ) -> CheckResult {
142140 if receipt. signed_receipt ( ) . message . nonce == FAILED_NONCE {
143141 Err ( CheckError :: Failed ( anyhow:: anyhow!( "Failed" ) ) )
0 commit comments