@@ -23,7 +23,7 @@ use tap_core::{signed_message::Eip712SignedMessage, tap_eip712_domain};
2323use tap_graph:: { Receipt , ReceiptAggregateVoucher , SignedRav , SignedReceipt } ;
2424use test_assets:: { flush_messages, TAP_SENDER as SENDER , TAP_SIGNER as SIGNER } ;
2525use thegraph_core:: alloy:: {
26- primitives:: { hex:: ToHexExt , Address , Bytes , U256 } ,
26+ primitives:: { hex:: ToHexExt , Address , Bytes , FixedBytes , U256 } ,
2727 signers:: local:: { coins_bip39:: English , MnemonicBuilder , PrivateKeySigner } ,
2828 sol_types:: Eip712Domain ,
2929} ;
@@ -268,7 +268,8 @@ pub trait CreateRav: NetworkVersion {
268268 /// function signature and don't require &self. The reason is that we can not match over T to get
269269 /// all variants because T is a trait and not an enum.
270270 fn create_rav (
271- allocation_id : Address ,
271+ allocation_id : Option < Address > ,
272+ collection_id : Option < FixedBytes < 32 > > ,
272273 signer_wallet : PrivateKeySigner ,
273274 timestamp_ns : u64 ,
274275 value_aggregate : u128 ,
@@ -277,23 +278,35 @@ pub trait CreateRav: NetworkVersion {
277278
278279impl CreateRav for Legacy {
279280 fn create_rav (
280- allocation_id : Address ,
281+ allocation_id : Option < Address > ,
282+ _collection_id : Option < FixedBytes < 32 > > ,
281283 signer_wallet : PrivateKeySigner ,
282284 timestamp_ns : u64 ,
283285 value_aggregate : u128 ,
284286 ) -> Eip712SignedMessage < Self :: Rav > {
285- create_rav ( allocation_id, signer_wallet, timestamp_ns, value_aggregate)
287+ create_rav (
288+ allocation_id. unwrap ( ) ,
289+ signer_wallet,
290+ timestamp_ns,
291+ value_aggregate,
292+ )
286293 }
287294}
288295
289296impl CreateRav for Horizon {
290297 fn create_rav (
291- allocation_id : Address ,
298+ _allocation_id : Option < Address > ,
299+ collection_id : Option < FixedBytes < 32 > > ,
292300 signer_wallet : PrivateKeySigner ,
293301 timestamp_ns : u64 ,
294302 value_aggregate : u128 ,
295303 ) -> Eip712SignedMessage < Self :: Rav > {
296- create_rav_v2 ( allocation_id, signer_wallet, timestamp_ns, value_aggregate)
304+ create_rav_v2 (
305+ collection_id. unwrap ( ) ,
306+ signer_wallet,
307+ timestamp_ns,
308+ value_aggregate,
309+ )
297310 }
298311}
299312
@@ -318,15 +331,15 @@ pub fn create_rav(
318331
319332/// Fixture to generate a RAV using the wallet from `keys()`
320333pub fn create_rav_v2 (
321- allocation_id : Address ,
334+ collection_id : FixedBytes < 32 > ,
322335 signer_wallet : PrivateKeySigner ,
323336 timestamp_ns : u64 ,
324337 value_aggregate : u128 ,
325338) -> tap_graph:: v2:: SignedRav {
326339 Eip712SignedMessage :: new (
327340 & TAP_EIP712_DOMAIN_SEPARATOR ,
328341 tap_graph:: v2:: ReceiptAggregateVoucher {
329- allocationId : allocation_id ,
342+ collectionId : collection_id ,
330343 timestampNs : timestamp_ns,
331344 valueAggregate : value_aggregate,
332345 payer : SENDER . 1 ,
@@ -345,7 +358,8 @@ pub trait CreateReceipt {
345358 /// function signature and don't require &self. The reason is that we can not match over T to get
346359 /// all variants because T is a trait and not an enum.
347360 fn create_received_receipt (
348- allocation_id : Address ,
361+ allocation_id : Option < Address > ,
362+ collection_id : Option < FixedBytes < 32 > > ,
349363 signer_wallet : & PrivateKeySigner ,
350364 nonce : u64 ,
351365 timestamp_ns : u64 ,
@@ -355,7 +369,8 @@ pub trait CreateReceipt {
355369
356370impl CreateReceipt for Horizon {
357371 fn create_received_receipt (
358- allocation_id : Address ,
372+ _allocation_id : Option < Address > ,
373+ collection_id : Option < FixedBytes < 32 > > ,
359374 signer_wallet : & PrivateKeySigner ,
360375 nonce : u64 ,
361376 timestamp_ns : u64 ,
@@ -364,7 +379,7 @@ impl CreateReceipt for Horizon {
364379 let receipt = Eip712SignedMessage :: new (
365380 & TAP_EIP712_DOMAIN_SEPARATOR ,
366381 tap_graph:: v2:: Receipt {
367- allocation_id ,
382+ collection_id : collection_id . unwrap ( ) ,
368383 payer : SENDER . 1 ,
369384 service_provider : INDEXER . 1 ,
370385 data_service : Address :: ZERO ,
@@ -381,7 +396,8 @@ impl CreateReceipt for Horizon {
381396
382397impl CreateReceipt for Legacy {
383398 fn create_received_receipt (
384- allocation_id : Address ,
399+ allocation_id : Option < Address > ,
400+ _collection_id : Option < FixedBytes < 32 > > ,
385401 signer_wallet : & PrivateKeySigner ,
386402 nonce : u64 ,
387403 timestamp_ns : u64 ,
@@ -390,7 +406,7 @@ impl CreateReceipt for Legacy {
390406 let receipt = Eip712SignedMessage :: new (
391407 & TAP_EIP712_DOMAIN_SEPARATOR ,
392408 Receipt {
393- allocation_id,
409+ allocation_id : allocation_id . unwrap ( ) ,
394410 nonce,
395411 timestamp_ns,
396412 value,
@@ -480,7 +496,7 @@ pub async fn store_receipt_v2(
480496 INSERT INTO tap_horizon_receipts (
481497 signer_address,
482498 signature,
483- allocation_id ,
499+ collection_id ,
484500 payer,
485501 data_service,
486502 service_provider,
@@ -492,7 +508,7 @@ pub async fn store_receipt_v2(
492508 "# ,
493509 signer,
494510 encoded_signature,
495- signed_receipt. message. allocation_id . encode_hex( ) ,
511+ signed_receipt. message. collection_id . encode_hex( ) ,
496512 signed_receipt. message. payer. encode_hex( ) ,
497513 signed_receipt. message. data_service. encode_hex( ) ,
498514 signed_receipt. message. service_provider. encode_hex( ) ,
0 commit comments