@@ -26,13 +26,16 @@ impl CardanoTransactionsBuilder {
2626 }
2727
2828 /// Define how many transactions we generate in each block.
29- pub fn per_block ( mut self , transactions_per_block : usize ) -> Self {
29+ pub fn max_transactions_per_block ( mut self , transactions_per_block : usize ) -> Self {
3030 self . max_transactions_per_block = transactions_per_block;
3131 self
3232 }
3333
3434 /// Define how many transactions we generate for one immutable_file.
35- pub fn per_immutable_file ( mut self , transactions_per_immutable_file : usize ) -> Self {
35+ pub fn max_transactions_per_immutable_file (
36+ mut self ,
37+ transactions_per_immutable_file : usize ,
38+ ) -> Self {
3639 self . max_transactions_per_immutable_file = transactions_per_immutable_file;
3740 self
3841 }
@@ -56,11 +59,6 @@ impl CardanoTransactionsBuilder {
5659 self
5760 }
5861
59- /// Default build that build only one transaction.
60- pub fn build ( self ) -> Vec < CardanoTransaction > {
61- self . build_transactions ( 1 )
62- }
63-
6462 /// Build the number of transactions requested.
6563 pub fn build_transactions ( self , transactions_count : usize ) -> Vec < CardanoTransaction > {
6664 let mut transactions = Vec :: new ( ) ;
@@ -147,13 +145,6 @@ mod test {
147145 list. iter ( ) . map ( extract_value) . collect ( )
148146 }
149147
150- #[ test]
151- fn return_one_transaction_by_default ( ) {
152- let transactions = CardanoTransactionsBuilder :: new ( ) . build ( ) ;
153-
154- assert_eq ! ( transactions. len( ) , 1 ) ;
155- }
156-
157148 #[ test]
158149 fn return_given_number_of_transactions_with_distinct_values ( ) {
159150 let txs = CardanoTransactionsBuilder :: new ( ) . build_transactions ( 3 ) ;
@@ -174,7 +165,7 @@ mod test {
174165 fn return_all_transactions_in_same_block_when_ask_less_transactions_than_transactions_per_block (
175166 ) {
176167 let txs = CardanoTransactionsBuilder :: new ( )
177- . per_block ( 10 )
168+ . max_transactions_per_block ( 10 )
178169 . build_transactions ( 3 ) ;
179170
180171 assert_eq ! ( txs. len( ) , 3 ) ;
@@ -190,7 +181,7 @@ mod test {
190181 #[ test]
191182 fn return_no_more_transactions_in_a_same_block_than_number_per_block_requested ( ) {
192183 let txs = CardanoTransactionsBuilder :: new ( )
193- . per_block ( 3 )
184+ . max_transactions_per_block ( 3 )
194185 . build_transactions ( 12 ) ;
195186
196187 assert_eq ! ( txs. len( ) , 12 ) ;
@@ -206,7 +197,7 @@ mod test {
206197 #[ test]
207198 fn only_the_last_block_is_not_full_when_we_can_not_fill_all_blocks ( ) {
208199 let txs = CardanoTransactionsBuilder :: new ( )
209- . per_block ( 5 )
200+ . max_transactions_per_block ( 5 )
210201 . build_transactions ( 12 ) ;
211202
212203 assert_eq ! ( txs. len( ) , 12 ) ;
@@ -245,7 +236,7 @@ mod test {
245236 #[ test]
246237 fn build_block_ranges_return_many_transactions_per_block_when_requested ( ) {
247238 let txs = CardanoTransactionsBuilder :: new ( )
248- . per_block ( 5 )
239+ . max_transactions_per_block ( 5 )
249240 . build_block_ranges ( 3 ) ;
250241
251242 assert_eq ! ( txs. len( ) , 3 * 5 ) ;
@@ -266,7 +257,7 @@ mod test {
266257 #[ test]
267258 fn build_block_ranges_with_many_blocks_per_block_ranges ( ) {
268259 let txs = CardanoTransactionsBuilder :: new ( )
269- . per_block ( 5 )
260+ . max_transactions_per_block ( 5 )
270261 . blocks_per_block_range ( 2 )
271262 . build_block_ranges ( 3 ) ;
272263
@@ -291,7 +282,7 @@ mod test {
291282 #[ test]
292283 fn build_transactions_with_many_blocks_per_block_ranges ( ) {
293284 let txs = CardanoTransactionsBuilder :: new ( )
294- . per_block ( 5 )
285+ . max_transactions_per_block ( 5 )
295286 . blocks_per_block_range ( 2 )
296287 . build_transactions ( 18 ) ;
297288
@@ -324,7 +315,7 @@ mod test {
324315 #[ test]
325316 fn build_transactions_with_many_transactions_per_immutable_file ( ) {
326317 let transactions = CardanoTransactionsBuilder :: new ( )
327- . per_immutable_file ( 5 )
318+ . max_transactions_per_immutable_file ( 5 )
328319 . build_transactions ( 18 ) ;
329320
330321 assert_eq ! ( transactions. len( ) , 18 ) ;
@@ -338,7 +329,7 @@ mod test {
338329 #[ test]
339330 fn build_transactions_with_same_number_of_transactions_per_immutable_file ( ) {
340331 let transactions = CardanoTransactionsBuilder :: new ( )
341- . per_immutable_file ( 5 )
332+ . max_transactions_per_immutable_file ( 5 )
342333 . build_transactions ( 20 ) ;
343334
344335 assert_eq ! ( transactions. len( ) , 20 ) ;
0 commit comments