@@ -190,18 +190,23 @@ impl TransactionBuilderConfigBuilder {
190190 }
191191 }
192192
193- pub fn fee_algo ( mut self , fee_algo : fees:: LinearFee ) -> Self {
194- self . fee_algo = Some ( fee_algo) ;
193+ pub fn fee_algo ( mut self , fee_algo : & fees:: LinearFee ) -> Self {
194+ self . fee_algo = Some ( fee_algo. clone ( ) ) ;
195195 self
196196 }
197197
198- pub fn pool_deposit ( mut self , pool_deposit : BigNum ) -> Self {
199- self . pool_deposit = Some ( pool_deposit ) ;
198+ pub fn coins_per_utxo_word ( mut self , coins_per_utxo_word : & Coin ) -> Self {
199+ self . coins_per_utxo_word = Some ( coins_per_utxo_word . clone ( ) ) ;
200200 self
201201 }
202202
203- pub fn key_deposit ( mut self , key_deposit : BigNum ) -> Self {
204- self . key_deposit = Some ( key_deposit) ;
203+ pub fn pool_deposit ( mut self , pool_deposit : & BigNum ) -> Self {
204+ self . pool_deposit = Some ( pool_deposit. clone ( ) ) ;
205+ self
206+ }
207+
208+ pub fn key_deposit ( mut self , key_deposit : & BigNum ) -> Self {
209+ self . key_deposit = Some ( key_deposit. clone ( ) ) ;
205210 self
206211 }
207212
@@ -215,11 +220,6 @@ impl TransactionBuilderConfigBuilder {
215220 self
216221 }
217222
218- pub fn coins_per_utxo_word ( mut self , coins_per_utxo_word : Coin ) -> Self {
219- self . coins_per_utxo_word = Some ( coins_per_utxo_word) ;
220- self
221- }
222-
223223 pub fn prefer_pure_change ( mut self , prefer_pure_change : bool ) -> Self {
224224 self . prefer_pure_change = prefer_pure_change;
225225 self
@@ -1134,12 +1134,12 @@ mod tests {
11341134 coins_per_utxo_word : u64 ,
11351135 ) -> TransactionBuilder {
11361136 let cfg = TransactionBuilderConfigBuilder :: new ( )
1137- . fee_algo ( linear_fee. clone ( ) )
1138- . pool_deposit ( to_bignum ( pool_deposit) )
1139- . key_deposit ( to_bignum ( key_deposit) )
1137+ . fee_algo ( linear_fee)
1138+ . pool_deposit ( & to_bignum ( pool_deposit) )
1139+ . key_deposit ( & to_bignum ( key_deposit) )
11401140 . max_value_size ( max_val_size)
11411141 . max_tx_size ( MAX_TX_SIZE )
1142- . coins_per_utxo_word ( to_bignum ( coins_per_utxo_word) )
1142+ . coins_per_utxo_word ( & to_bignum ( coins_per_utxo_word) )
11431143 . build ( )
11441144 . unwrap ( ) ;
11451145 TransactionBuilder :: new ( & cfg)
@@ -1173,12 +1173,12 @@ mod tests {
11731173
11741174 fn create_tx_builder_with_fee_and_pure_change ( linear_fee : & LinearFee ) -> TransactionBuilder {
11751175 TransactionBuilder :: new ( & TransactionBuilderConfigBuilder :: new ( )
1176- . fee_algo ( linear_fee. clone ( ) )
1177- . pool_deposit ( to_bignum ( 1 ) )
1178- . key_deposit ( to_bignum ( 1 ) )
1176+ . fee_algo ( linear_fee)
1177+ . pool_deposit ( & to_bignum ( 1 ) )
1178+ . key_deposit ( & to_bignum ( 1 ) )
11791179 . max_value_size ( MAX_VALUE_SIZE )
11801180 . max_tx_size ( MAX_TX_SIZE )
1181- . coins_per_utxo_word ( to_bignum ( 1 ) )
1181+ . coins_per_utxo_word ( & to_bignum ( 1 ) )
11821182 . prefer_pure_change ( true )
11831183 . build ( )
11841184 . unwrap ( ) )
@@ -2589,12 +2589,12 @@ mod tests {
25892589 // we have a = 1 to test increasing fees when more inputs are added
25902590 let linear_fee = LinearFee :: new ( & to_bignum ( 1 ) , & to_bignum ( 0 ) ) ;
25912591 let cfg = TransactionBuilderConfigBuilder :: new ( )
2592- . fee_algo ( linear_fee)
2593- . pool_deposit ( to_bignum ( 0 ) )
2594- . key_deposit ( to_bignum ( 0 ) )
2592+ . fee_algo ( & linear_fee)
2593+ . pool_deposit ( & to_bignum ( 0 ) )
2594+ . key_deposit ( & to_bignum ( 0 ) )
25952595 . max_value_size ( 9999 )
25962596 . max_tx_size ( 9999 )
2597- . coins_per_utxo_word ( Coin :: zero ( ) )
2597+ . coins_per_utxo_word ( & Coin :: zero ( ) )
25982598 . build ( )
25992599 . unwrap ( ) ;
26002600 let mut tx_builder = TransactionBuilder :: new ( & cfg) ;
@@ -2616,12 +2616,12 @@ mod tests {
26162616 // we have a = 1 to test increasing fees when more inputs are added
26172617 let linear_fee = LinearFee :: new ( & to_bignum ( 1 ) , & to_bignum ( 0 ) ) ;
26182618 let cfg = TransactionBuilderConfigBuilder :: new ( )
2619- . fee_algo ( linear_fee)
2620- . pool_deposit ( to_bignum ( 0 ) )
2621- . key_deposit ( to_bignum ( 0 ) )
2619+ . fee_algo ( & linear_fee)
2620+ . pool_deposit ( & to_bignum ( 0 ) )
2621+ . key_deposit ( & to_bignum ( 0 ) )
26222622 . max_value_size ( 9999 )
26232623 . max_tx_size ( 9999 )
2624- . coins_per_utxo_word ( Coin :: zero ( ) )
2624+ . coins_per_utxo_word ( & Coin :: zero ( ) )
26252625 . build ( )
26262626 . unwrap ( ) ;
26272627 let mut tx_builder = TransactionBuilder :: new ( & cfg) ;
0 commit comments