@@ -190,18 +190,23 @@ impl TransactionBuilderConfigBuilder {
190
190
}
191
191
}
192
192
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 ( ) ) ;
195
195
self
196
196
}
197
197
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 ( ) ) ;
200
200
self
201
201
}
202
202
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 ( ) ) ;
205
210
self
206
211
}
207
212
@@ -215,11 +220,6 @@ impl TransactionBuilderConfigBuilder {
215
220
self
216
221
}
217
222
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
-
223
223
pub fn prefer_pure_change ( mut self , prefer_pure_change : bool ) -> Self {
224
224
self . prefer_pure_change = prefer_pure_change;
225
225
self
@@ -1134,12 +1134,12 @@ mod tests {
1134
1134
coins_per_utxo_word : u64 ,
1135
1135
) -> TransactionBuilder {
1136
1136
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) )
1140
1140
. max_value_size ( max_val_size)
1141
1141
. 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) )
1143
1143
. build ( )
1144
1144
. unwrap ( ) ;
1145
1145
TransactionBuilder :: new ( & cfg)
@@ -1173,12 +1173,12 @@ mod tests {
1173
1173
1174
1174
fn create_tx_builder_with_fee_and_pure_change ( linear_fee : & LinearFee ) -> TransactionBuilder {
1175
1175
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 ) )
1179
1179
. max_value_size ( MAX_VALUE_SIZE )
1180
1180
. max_tx_size ( MAX_TX_SIZE )
1181
- . coins_per_utxo_word ( to_bignum ( 1 ) )
1181
+ . coins_per_utxo_word ( & to_bignum ( 1 ) )
1182
1182
. prefer_pure_change ( true )
1183
1183
. build ( )
1184
1184
. unwrap ( ) )
@@ -2589,12 +2589,12 @@ mod tests {
2589
2589
// we have a = 1 to test increasing fees when more inputs are added
2590
2590
let linear_fee = LinearFee :: new ( & to_bignum ( 1 ) , & to_bignum ( 0 ) ) ;
2591
2591
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 ) )
2595
2595
. max_value_size ( 9999 )
2596
2596
. max_tx_size ( 9999 )
2597
- . coins_per_utxo_word ( Coin :: zero ( ) )
2597
+ . coins_per_utxo_word ( & Coin :: zero ( ) )
2598
2598
. build ( )
2599
2599
. unwrap ( ) ;
2600
2600
let mut tx_builder = TransactionBuilder :: new ( & cfg) ;
@@ -2616,12 +2616,12 @@ mod tests {
2616
2616
// we have a = 1 to test increasing fees when more inputs are added
2617
2617
let linear_fee = LinearFee :: new ( & to_bignum ( 1 ) , & to_bignum ( 0 ) ) ;
2618
2618
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 ) )
2622
2622
. max_value_size ( 9999 )
2623
2623
. max_tx_size ( 9999 )
2624
- . coins_per_utxo_word ( Coin :: zero ( ) )
2624
+ . coins_per_utxo_word ( & Coin :: zero ( ) )
2625
2625
. build ( )
2626
2626
. unwrap ( ) ;
2627
2627
let mut tx_builder = TransactionBuilder :: new ( & cfg) ;
0 commit comments