@@ -9,16 +9,16 @@ use alloy::{
99} ;
1010use anyhow:: { bail, Ok , Result } ;
1111use rayon:: prelude:: * ;
12- use tap_core:: signed_message:: { EIP712SignedMessage , SignatureBytes , SignatureBytesExt } ;
12+ use tap_core:: signed_message:: { Eip712SignedMessage , SignatureBytes , SignatureBytesExt } ;
1313use tap_graph:: { Receipt , ReceiptAggregateVoucher } ;
1414
1515pub fn check_and_aggregate_receipts (
1616 domain_separator : & Eip712Domain ,
17- receipts : & [ EIP712SignedMessage < Receipt > ] ,
18- previous_rav : Option < EIP712SignedMessage < ReceiptAggregateVoucher > > ,
17+ receipts : & [ Eip712SignedMessage < Receipt > ] ,
18+ previous_rav : Option < Eip712SignedMessage < ReceiptAggregateVoucher > > ,
1919 wallet : & PrivateKeySigner ,
2020 accepted_addresses : & HashSet < Address > ,
21- ) -> Result < EIP712SignedMessage < ReceiptAggregateVoucher > > {
21+ ) -> Result < Eip712SignedMessage < ReceiptAggregateVoucher > > {
2222 check_signatures_unique ( receipts) ?;
2323
2424 // Check that the receipts are signed by an accepted signer address
@@ -63,11 +63,11 @@ pub fn check_and_aggregate_receipts(
6363 let rav = ReceiptAggregateVoucher :: aggregate_receipts ( allocation_id, receipts, previous_rav) ?;
6464
6565 // Sign the rav and return
66- Ok ( EIP712SignedMessage :: new ( domain_separator, rav, wallet) ?)
66+ Ok ( Eip712SignedMessage :: new ( domain_separator, rav, wallet) ?)
6767}
6868
6969fn check_signature_is_from_one_of_addresses < M : SolStruct > (
70- message : & EIP712SignedMessage < M > ,
70+ message : & Eip712SignedMessage < M > ,
7171 domain_separator : & Eip712Domain ,
7272 accepted_addresses : & HashSet < Address > ,
7373) -> Result < ( ) > {
@@ -81,7 +81,7 @@ fn check_signature_is_from_one_of_addresses<M: SolStruct>(
8181}
8282
8383fn check_allocation_id (
84- receipts : & [ EIP712SignedMessage < Receipt > ] ,
84+ receipts : & [ Eip712SignedMessage < Receipt > ] ,
8585 allocation_id : Address ,
8686) -> Result < ( ) > {
8787 for receipt in receipts. iter ( ) {
@@ -93,7 +93,7 @@ fn check_allocation_id(
9393 Ok ( ( ) )
9494}
9595
96- fn check_signatures_unique ( receipts : & [ EIP712SignedMessage < Receipt > ] ) -> Result < ( ) > {
96+ fn check_signatures_unique ( receipts : & [ Eip712SignedMessage < Receipt > ] ) -> Result < ( ) > {
9797 let mut receipt_signatures: hash_set:: HashSet < SignatureBytes > = hash_set:: HashSet :: new ( ) ;
9898 for receipt in receipts. iter ( ) {
9999 let signature = receipt. signature . get_signature_bytes ( ) ;
@@ -109,8 +109,8 @@ fn check_signatures_unique(receipts: &[EIP712SignedMessage<Receipt>]) -> Result<
109109}
110110
111111fn check_receipt_timestamps (
112- receipts : & [ EIP712SignedMessage < Receipt > ] ,
113- previous_rav : Option < & EIP712SignedMessage < ReceiptAggregateVoucher > > ,
112+ receipts : & [ Eip712SignedMessage < Receipt > ] ,
113+ previous_rav : Option < & Eip712SignedMessage < ReceiptAggregateVoucher > > ,
114114) -> Result < ( ) > {
115115 if let Some ( previous_rav) = & previous_rav {
116116 for receipt in receipts. iter ( ) {
@@ -134,7 +134,7 @@ mod tests {
134134
135135 use alloy:: { dyn_abi:: Eip712Domain , primitives:: Address , signers:: local:: PrivateKeySigner } ;
136136 use rstest:: * ;
137- use tap_core:: { signed_message:: EIP712SignedMessage , tap_eip712_domain} ;
137+ use tap_core:: { signed_message:: Eip712SignedMessage , tap_eip712_domain} ;
138138 use tap_graph:: { Receipt , ReceiptAggregateVoucher } ;
139139
140140 use crate :: aggregator;
@@ -170,7 +170,7 @@ mod tests {
170170 ) {
171171 // Create the same receipt twice (replay attack)
172172 let mut receipts = Vec :: new ( ) ;
173- let receipt = EIP712SignedMessage :: new (
173+ let receipt = Eip712SignedMessage :: new (
174174 & domain_separator,
175175 Receipt :: new ( allocation_ids[ 0 ] , 42 ) . unwrap ( ) ,
176176 & keys. 0 ,
@@ -192,13 +192,13 @@ mod tests {
192192 ) {
193193 // Create 2 different receipts
194194 let receipts = vec ! [
195- EIP712SignedMessage :: new(
195+ Eip712SignedMessage :: new(
196196 & domain_separator,
197197 Receipt :: new( allocation_ids[ 0 ] , 42 ) . unwrap( ) ,
198198 & keys. 0 ,
199199 )
200200 . unwrap( ) ,
201- EIP712SignedMessage :: new(
201+ Eip712SignedMessage :: new(
202202 & domain_separator,
203203 Receipt :: new( allocation_ids[ 0 ] , 43 ) . unwrap( ) ,
204204 & keys. 0 ,
@@ -223,7 +223,7 @@ mod tests {
223223 let mut receipts = Vec :: new ( ) ;
224224 for i in receipt_timestamp_range. clone ( ) {
225225 receipts. push (
226- EIP712SignedMessage :: new (
226+ Eip712SignedMessage :: new (
227227 & domain_separator,
228228 Receipt {
229229 allocation_id : allocation_ids[ 0 ] ,
@@ -238,7 +238,7 @@ mod tests {
238238 }
239239
240240 // Create rav with max_timestamp below the receipts timestamps
241- let rav = EIP712SignedMessage :: new (
241+ let rav = Eip712SignedMessage :: new (
242242 & domain_separator,
243243 ReceiptAggregateVoucher {
244244 allocationId : allocation_ids[ 0 ] ,
@@ -252,7 +252,7 @@ mod tests {
252252
253253 // Create rav with max_timestamp equal to the lowest receipt timestamp
254254 // Aggregation should fail
255- let rav = EIP712SignedMessage :: new (
255+ let rav = Eip712SignedMessage :: new (
256256 & domain_separator,
257257 ReceiptAggregateVoucher {
258258 allocationId : allocation_ids[ 0 ] ,
@@ -266,7 +266,7 @@ mod tests {
266266
267267 // Create rav with max_timestamp above highest receipt timestamp
268268 // Aggregation should fail
269- let rav = EIP712SignedMessage :: new (
269+ let rav = Eip712SignedMessage :: new (
270270 & domain_separator,
271271 ReceiptAggregateVoucher {
272272 allocationId : allocation_ids[ 0 ] ,
@@ -289,19 +289,19 @@ mod tests {
289289 domain_separator : Eip712Domain ,
290290 ) {
291291 let receipts = vec ! [
292- EIP712SignedMessage :: new(
292+ Eip712SignedMessage :: new(
293293 & domain_separator,
294294 Receipt :: new( allocation_ids[ 0 ] , 42 ) . unwrap( ) ,
295295 & keys. 0 ,
296296 )
297297 . unwrap( ) ,
298- EIP712SignedMessage :: new(
298+ Eip712SignedMessage :: new(
299299 & domain_separator,
300300 Receipt :: new( allocation_ids[ 0 ] , 43 ) . unwrap( ) ,
301301 & keys. 0 ,
302302 )
303303 . unwrap( ) ,
304- EIP712SignedMessage :: new(
304+ Eip712SignedMessage :: new(
305305 & domain_separator,
306306 Receipt :: new( allocation_ids[ 1 ] , 44 ) . unwrap( ) ,
307307 & keys. 0 ,
@@ -323,19 +323,19 @@ mod tests {
323323 domain_separator : Eip712Domain ,
324324 ) {
325325 let receipts = vec ! [
326- EIP712SignedMessage :: new(
326+ Eip712SignedMessage :: new(
327327 & domain_separator,
328328 Receipt :: new( allocation_ids[ 0 ] , 42 ) . unwrap( ) ,
329329 & keys. 0 ,
330330 )
331331 . unwrap( ) ,
332- EIP712SignedMessage :: new(
332+ Eip712SignedMessage :: new(
333333 & domain_separator,
334334 Receipt :: new( allocation_ids[ 0 ] , 43 ) . unwrap( ) ,
335335 & keys. 0 ,
336336 )
337337 . unwrap( ) ,
338- EIP712SignedMessage :: new(
338+ Eip712SignedMessage :: new(
339339 & domain_separator,
340340 Receipt :: new( allocation_ids[ 0 ] , 44 ) . unwrap( ) ,
341341 & keys. 0 ,
0 commit comments