@@ -130,14 +130,12 @@ fn check_receipt_timestamps(
130130
131131#[ cfg( test) ]
132132mod tests {
133- use std:: str:: FromStr ;
134-
135133 use rstest:: * ;
136134 use tap_core:: { signed_message:: Eip712SignedMessage , tap_eip712_domain} ;
137135 use tap_graph:: { Receipt , ReceiptAggregateVoucher } ;
138136 use thegraph_core:: alloy:: {
139137 dyn_abi:: Eip712Domain ,
140- primitives:: { Address , U256 } ,
138+ primitives:: { address , Address , U256 } ,
141139 signers:: { local:: PrivateKeySigner , Signature } ,
142140 } ;
143141
@@ -153,10 +151,10 @@ mod tests {
153151 #[ fixture]
154152 fn allocation_ids ( ) -> Vec < Address > {
155153 vec ! [
156- Address :: from_str ( "0xabababababababababababababababababababab" ) . unwrap ( ) ,
157- Address :: from_str ( "0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddead" ) . unwrap ( ) ,
158- Address :: from_str ( "0xbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef" ) . unwrap ( ) ,
159- Address :: from_str ( "0x1234567890abcdef1234567890abcdef12345678" ) . unwrap ( ) ,
154+ address! ( "0xabababababababababababababababababababab" ) ,
155+ address! ( "0xdeaddeaddeaddeaddeaddeaddeaddeaddeaddead" ) ,
156+ address! ( "0xbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef" ) ,
157+ address! ( "0x1234567890abcdef1234567890abcdef12345678" ) ,
160158 ]
161159 }
162160
@@ -175,7 +173,7 @@ mod tests {
175173 // Create a test receipt
176174 let receipt = Eip712SignedMessage :: new (
177175 & domain_separator,
178- Receipt :: new ( allocation_ids[ 0 ] , 42 ) . unwrap ( ) ,
176+ Receipt :: new ( allocation_ids[ 0 ] , U256 :: from ( 42 ) ) . unwrap ( ) ,
179177 & keys. 0 ,
180178 )
181179 . unwrap ( ) ;
@@ -236,7 +234,7 @@ mod tests {
236234 let mut receipts = Vec :: new ( ) ;
237235 let receipt = Eip712SignedMessage :: new (
238236 & domain_separator,
239- Receipt :: new ( allocation_ids[ 0 ] , 42 ) . unwrap ( ) ,
237+ Receipt :: new ( allocation_ids[ 0 ] , U256 :: from ( 42 ) ) . unwrap ( ) ,
240238 & keys. 0 ,
241239 )
242240 . unwrap ( ) ;
@@ -258,13 +256,13 @@ mod tests {
258256 let receipts = vec ! [
259257 Eip712SignedMessage :: new(
260258 & domain_separator,
261- Receipt :: new( allocation_ids[ 0 ] , 42 ) . unwrap( ) ,
259+ Receipt :: new( allocation_ids[ 0 ] , U256 :: from ( 42 ) ) . unwrap( ) ,
262260 & keys. 0 ,
263261 )
264262 . unwrap( ) ,
265263 Eip712SignedMessage :: new(
266264 & domain_separator,
267- Receipt :: new( allocation_ids[ 0 ] , 43 ) . unwrap( ) ,
265+ Receipt :: new( allocation_ids[ 0 ] , U256 :: from ( 43 ) ) . unwrap( ) ,
268266 & keys. 0 ,
269267 )
270268 . unwrap( ) ,
@@ -293,7 +291,7 @@ mod tests {
293291 allocation_id : allocation_ids[ 0 ] ,
294292 timestamp_ns : i,
295293 nonce : 0 ,
296- value : 42 ,
294+ value : U256 :: from ( 42 ) ,
297295 } ,
298296 & keys. 0 ,
299297 )
@@ -307,7 +305,7 @@ mod tests {
307305 ReceiptAggregateVoucher {
308306 allocationId : allocation_ids[ 0 ] ,
309307 timestampNs : receipt_timestamp_range. clone ( ) . min ( ) . unwrap ( ) - 1 ,
310- valueAggregate : 42 ,
308+ valueAggregate : U256 :: from ( 42 ) ,
311309 } ,
312310 & keys. 0 ,
313311 )
@@ -321,7 +319,7 @@ mod tests {
321319 ReceiptAggregateVoucher {
322320 allocationId : allocation_ids[ 0 ] ,
323321 timestampNs : receipt_timestamp_range. clone ( ) . min ( ) . unwrap ( ) ,
324- valueAggregate : 42 ,
322+ valueAggregate : U256 :: from ( 42 ) ,
325323 } ,
326324 & keys. 0 ,
327325 )
@@ -335,7 +333,7 @@ mod tests {
335333 ReceiptAggregateVoucher {
336334 allocationId : allocation_ids[ 0 ] ,
337335 timestampNs : receipt_timestamp_range. clone ( ) . max ( ) . unwrap ( ) + 1 ,
338- valueAggregate : 42 ,
336+ valueAggregate : U256 :: from ( 42 ) ,
339337 } ,
340338 & keys. 0 ,
341339 )
@@ -355,19 +353,19 @@ mod tests {
355353 let receipts = vec ! [
356354 Eip712SignedMessage :: new(
357355 & domain_separator,
358- Receipt :: new( allocation_ids[ 0 ] , 42 ) . unwrap( ) ,
356+ Receipt :: new( allocation_ids[ 0 ] , U256 :: from ( 42 ) ) . unwrap( ) ,
359357 & keys. 0 ,
360358 )
361359 . unwrap( ) ,
362360 Eip712SignedMessage :: new(
363361 & domain_separator,
364- Receipt :: new( allocation_ids[ 0 ] , 43 ) . unwrap( ) ,
362+ Receipt :: new( allocation_ids[ 0 ] , U256 :: from ( 43 ) ) . unwrap( ) ,
365363 & keys. 0 ,
366364 )
367365 . unwrap( ) ,
368366 Eip712SignedMessage :: new(
369367 & domain_separator,
370- Receipt :: new( allocation_ids[ 1 ] , 44 ) . unwrap( ) ,
368+ Receipt :: new( allocation_ids[ 1 ] , U256 :: from ( 44 ) ) . unwrap( ) ,
371369 & keys. 0 ,
372370 )
373371 . unwrap( ) ,
@@ -389,19 +387,19 @@ mod tests {
389387 let receipts = vec ! [
390388 Eip712SignedMessage :: new(
391389 & domain_separator,
392- Receipt :: new( allocation_ids[ 0 ] , 42 ) . unwrap( ) ,
390+ Receipt :: new( allocation_ids[ 0 ] , U256 :: from ( 42 ) ) . unwrap( ) ,
393391 & keys. 0 ,
394392 )
395393 . unwrap( ) ,
396394 Eip712SignedMessage :: new(
397395 & domain_separator,
398- Receipt :: new( allocation_ids[ 0 ] , 43 ) . unwrap( ) ,
396+ Receipt :: new( allocation_ids[ 0 ] , U256 :: from ( 43 ) ) . unwrap( ) ,
399397 & keys. 0 ,
400398 )
401399 . unwrap( ) ,
402400 Eip712SignedMessage :: new(
403401 & domain_separator,
404- Receipt :: new( allocation_ids[ 0 ] , 44 ) . unwrap( ) ,
402+ Receipt :: new( allocation_ids[ 0 ] , U256 :: from ( 44 ) ) . unwrap( ) ,
405403 & keys. 0 ,
406404 )
407405 . unwrap( ) ,
0 commit comments