@@ -35,7 +35,7 @@ pub struct IndexerClient {
3535}
3636
3737pub enum IndexerAuth < ' a > {
38- Paid ( & ' a Receipt , & ' a Eip712Domain ) ,
38+ Paid ( & ' a Receipt , & ' a Eip712Domain , & ' a Eip712Domain ) ,
3939 Free ( & ' a str ) ,
4040}
4141
@@ -47,7 +47,7 @@ impl IndexerClient {
4747 query : & str ,
4848 ) -> Result < IndexerResponse , IndexerError > {
4949 let ( auth_key, auth_value) = match auth {
50- IndexerAuth :: Paid ( receipt, _) => ( "Tap-Receipt" , receipt. serialize ( ) ) ,
50+ IndexerAuth :: Paid ( receipt, _, _ ) => ( "Tap-Receipt" , receipt. serialize ( ) ) ,
5151 IndexerAuth :: Free ( token) => ( AUTHORIZATION . as_str ( ) , format ! ( "Bearer {token}" ) ) ,
5252 } ;
5353
@@ -113,18 +113,26 @@ impl IndexerClient {
113113 return Err ( BadResponse ( format ! ( "unattestable response: {error}" ) ) ) ;
114114 }
115115
116- if let IndexerAuth :: Paid ( receipt, attestation_domain) = auth {
116+ if let IndexerAuth :: Paid ( receipt, attestation_domain, legacy_attestation_domain ) = auth {
117117 match & payload. attestation {
118118 Some ( attestation) => {
119119 let allocation = receipt. allocation ( ) ;
120- if let Err ( err ) = attestation:: verify (
121- attestation_domain ,
120+ if let Err ( legacy_err ) = attestation:: verify (
121+ legacy_attestation_domain ,
122122 attestation,
123123 & allocation,
124124 query,
125125 & original_response,
126126 ) {
127- return Err ( BadResponse ( format ! ( "bad attestation: {err}" ) ) ) ;
127+ if let Err ( err) = attestation:: verify (
128+ attestation_domain,
129+ attestation,
130+ & allocation,
131+ query,
132+ & original_response,
133+ ) {
134+ return Err ( BadResponse ( format ! ( "bad attestation: {legacy_err} - {err}" ) ) ) ;
135+ }
128136 }
129137 }
130138 None => {
0 commit comments