11use sov_modules_api:: macros:: config_value;
22use sov_modules_api:: { CredentialId , TxEffect } ;
3+ use sov_modules_api:: capabilities:: UniquenessData ;
34use sov_test_utils:: { BatchType , SlotInput , TransactionTestCase , TxProcessingError } ;
45use sov_uniqueness:: Uniqueness ;
56
@@ -58,15 +59,15 @@ fn do_max_stored_tx_hashes_per_credential_test() {
5859 // Generate txs to fill up our "bucket" of stored transaction hashes.
5960 for i in 0 ..txs_per_generation {
6061 for generation in 0 ..num_generations {
61- txs. push ( generate_value_setter_tx ( generation, i as u32 , & admin) ) ;
62+ txs. push ( generate_value_setter_tx ( UniquenessData :: Generation ( generation) , i as u32 , & admin) ) ;
6263 }
6364 }
6465 // We divided txs evenly across generations - if there was a remainder, account for it by putting the
6566 // extra txs in the first bucket.
6667 for i in 0 ..extra_txs_in_first_generation {
6768 txs. push ( generate_value_setter_tx (
68- 0 ,
69- ( i + txs_per_generation) as u32 ,
69+ UniquenessData :: Generation ( 0 ) ,
70+ ( i + txs_per_generation) as u32 ,
7071 & admin,
7172 ) )
7273 }
@@ -87,7 +88,7 @@ fn do_max_stored_tx_hashes_per_credential_test() {
8788 // Send one more transaction with a current generation number.
8889 // This transaction should be skipped because it would cause the bucket to overflow.
8990 runner. execute_transaction ( TransactionTestCase {
90- input : generate_value_setter_tx ( 0 , u32:: MAX , & admin) ,
91+ input : generate_value_setter_tx ( UniquenessData :: Generation ( 0 ) , u32:: MAX , & admin) ,
9192 assert : Box :: new ( move |ctx, _| {
9293 let TxEffect :: Skipped ( skipped) = ctx. tx_receipt else {
9394 panic ! ( "Transaction should be skipped" ) ;
@@ -106,7 +107,7 @@ fn do_max_stored_tx_hashes_per_credential_test() {
106107 // Increment the generation number. Now the transaction should be accepted because it won't cause the bucket to overflow.
107108 // Note that we need to add 1 to the number of generations because we have a strict inequality comparison for buckets.
108109 runner. execute_transaction ( TransactionTestCase {
109- input : generate_value_setter_tx ( num_generations + 1 , txs_per_generation as u32 , & admin) ,
110+ input : generate_value_setter_tx ( UniquenessData :: Generation ( num_generations + 1 ) , txs_per_generation as u32 , & admin) ,
110111 assert : Box :: new ( move |ctx, _| {
111112 assert ! (
112113 ctx. tx_receipt. is_successful( ) ,
0 commit comments