Skip to content

Commit c4ea370

Browse files
authored
Merge pull request #526 from Emurgo/evgenii/remove_old_min_out_ada
Remove old "min ada for output" logic
2 parents 2e04521 + 6bce0a6 commit c4ea370

File tree

3 files changed

+4
-137
lines changed

3 files changed

+4
-137
lines changed

rust/src/lib.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,6 @@ impl DataCost {
258258
}
259259
}
260260
}
261-
262-
// <TODO:REMOVE_AFTER_BABBAGE>
263-
pub(crate) fn coins_per_word(&self) -> Result<Coin, JsError> {
264-
match &self.0 {
265-
DataCostEnum::CoinsPerByte(coins_per_byte) => {
266-
coins_per_byte
267-
.checked_mul(&BigNum::from_str("8")?)
268-
},
269-
DataCostEnum::CoinsPerWord(coins_per_word) => Ok(coins_per_word.clone()),
270-
}
271-
}
272261
}
273262

274263
#[wasm_bindgen]

rust/src/tx_builder.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,7 +1994,6 @@ mod tests {
19941994
create_tx_builder_with_fee(&create_default_linear_fee())
19951995
}
19961996

1997-
#[ignore]
19981997
#[test]
19991998
fn build_tx_with_change() {
20001999
let mut tx_builder = create_default_tx_builder();
@@ -2221,7 +2220,6 @@ mod tests {
22212220
let _final_tx = tx_builder.build(); // just test that it doesn't throw
22222221
}
22232222

2224-
#[ignore]
22252223
#[test]
22262224
fn build_tx_exact_amount() {
22272225
// transactions where sum(input) == sum(output) exact should pass
@@ -2286,7 +2284,6 @@ mod tests {
22862284
assert_eq!(final_tx.outputs().len(), 1);
22872285
}
22882286

2289-
#[ignore]
22902287
#[test]
22912288
fn build_tx_exact_change() {
22922289
// transactions where we have exactly enough ADA to add change should pass
@@ -2750,7 +2747,6 @@ mod tests {
27502747
assert_eq!(deser_t.to_json().unwrap(), final_tx.to_json().unwrap());
27512748
}
27522749

2753-
#[ignore]
27542750
#[test]
27552751
fn build_tx_with_mint_all_sent() {
27562752
let mut tx_builder = create_tx_builder_with_fee(&create_linear_fee(0, 1));
@@ -2839,7 +2835,6 @@ mod tests {
28392835
assert!(change.multiasset().is_none());
28402836
}
28412837

2842-
#[ignore]
28432838
#[test]
28442839
fn build_tx_with_mint_in_change() {
28452840
let mut tx_builder = create_tx_builder_with_fee(&create_linear_fee(0, 1));
@@ -3127,7 +3122,6 @@ mod tests {
31273122
assert!(added_change.is_err());
31283123
}
31293124

3130-
#[ignore]
31313125
#[test]
31323126
fn build_tx_with_native_assets_change() {
31333127
let mut tx_builder = create_tx_builder_with_fee(&create_linear_fee(0, 1));
@@ -3241,7 +3235,6 @@ mod tests {
32413235
assert_eq!(final_tx.outputs().get(1).amount().coin(), to_bignum(599));
32423236
}
32433237

3244-
#[ignore]
32453238
#[test]
32463239
fn build_tx_with_native_assets_change_and_purification() {
32473240
let coin_per_utxo_word = to_bignum(8);
@@ -3370,7 +3363,6 @@ mod tests {
33703363
assert_eq!(final_tx.outputs().get(2).amount().multiasset(), None);
33713364
}
33723365

3373-
#[ignore]
33743366
#[test]
33753367
fn build_tx_with_native_assets_change_and_no_purification_cuz_not_enough_pure_coin() {
33763368
// Prefer pure change!
@@ -3787,7 +3779,6 @@ mod tests {
37873779
return (multiasset, policy_ids, names);
37883780
}
37893781

3790-
#[ignore]
37913782
#[test]
37923783
fn build_tx_add_change_split_nfts() {
37933784
let max_value_size = 100; // super low max output size to test with fewer assets
@@ -3894,7 +3885,6 @@ mod tests {
38943885
.is_err());
38953886
}
38963887

3897-
#[ignore]
38983888
#[test]
38993889
fn build_tx_add_change_nfts_not_enough_ada() {
39003890
let mut tx_builder = create_tx_builder_with_fee_and_val_size(
@@ -4075,7 +4065,6 @@ mod tests {
40754065
assert_eq!(3u8, tx.inputs().get(1).transaction_id().0[0]);
40764066
}
40774067

4078-
#[ignore]
40794068
#[test]
40804069
fn tx_builder_cip2_largest_first_multiasset() {
40814070
// we have a = 0 so we know adding inputs/outputs doesn't change the fee so we can analyze more
@@ -4195,7 +4184,6 @@ mod tests {
41954184
assert_eq!(expected_change, change);
41964185
}
41974186

4198-
#[ignore]
41994187
#[test]
42004188
fn tx_builder_cip2_random_improve_multiasset() {
42014189
let mut tx_builder = create_tx_builder_with_fee(&create_linear_fee(0, 0));
@@ -4404,7 +4392,6 @@ mod tests {
44044392
assert!(add_inputs_res.is_ok(), "{:?}", add_inputs_res.err());
44054393
}
44064394

4407-
#[ignore]
44084395
#[test]
44094396
fn tx_builder_cip2_random_improve_adds_enough_for_fees() {
44104397
// we have a = 1 to test increasing fees when more inputs are added
@@ -4729,7 +4716,6 @@ mod tests {
47294716
);
47304717
}
47314718

4732-
#[ignore]
47334719
#[test]
47344720
fn add_change_splits_change_into_multiple_outputs_when_nfts_overflow_output_size() {
47354721
let linear_fee = LinearFee::new(&to_bignum(0), &to_bignum(1));
@@ -5154,7 +5140,6 @@ mod tests {
51545140
assert_eq!(mint_scripts.get(1), mint_script2);
51555141
}
51565142

5157-
#[ignore]
51585143
#[test]
51595144
fn add_output_amount() {
51605145
let mut tx_builder = create_default_tx_builder();
@@ -5184,7 +5169,6 @@ mod tests {
51845169
assert_eq!(out.amount, value);
51855170
}
51865171

5187-
#[ignore]
51885172
#[test]
51895173
fn add_output_coin() {
51905174
let mut tx_builder = create_default_tx_builder();
@@ -5211,7 +5195,6 @@ mod tests {
52115195
assert!(out.amount.multiasset.is_none());
52125196
}
52135197

5214-
#[ignore]
52155198
#[test]
52165199
fn add_output_coin_and_multiasset() {
52175200
let mut tx_builder = create_default_tx_builder();
@@ -5242,7 +5225,6 @@ mod tests {
52425225
assert_eq!(out.amount.multiasset.unwrap(), multiasset);
52435226
}
52445227

5245-
#[ignore]
52465228
#[test]
52475229
fn add_output_asset_and_min_required_coin() {
52485230
let mut tx_builder = create_reallistic_tx_builder();
@@ -5276,7 +5258,6 @@ mod tests {
52765258
assert_eq!(out.amount.coin, to_bignum(1146460));
52775259
}
52785260

5279-
#[ignore]
52805261
#[test]
52815262
fn add_mint_asset_and_output() {
52825263
let mut tx_builder = create_default_tx_builder();
@@ -5340,7 +5321,6 @@ mod tests {
53405321
assert_eq!(asset.get(&name).unwrap(), to_bignum(1234));
53415322
}
53425323

5343-
#[ignore]
53445324
#[test]
53455325
fn add_mint_asset_and_min_required_coin() {
53465326
let mut tx_builder = create_reallistic_tx_builder();
@@ -5547,7 +5527,6 @@ mod tests {
55475527
// assert!(est5.err().unwrap().to_string().contains("witness scripts are not provided"));
55485528
}
55495529

5550-
#[ignore]
55515530
#[test]
55525531
fn total_input_output_with_mint_and_burn() {
55535532
let mut tx_builder = create_tx_builder_with_fee(&create_linear_fee(0, 1));
@@ -6666,7 +6645,6 @@ mod tests {
66666645
);
66676646
}
66686647

6669-
#[ignore]
66706648
#[test]
66716649
fn test_auto_calc_total_collateral() {
66726650
let mut tx_builder = create_reallistic_tx_builder();
@@ -6702,7 +6680,6 @@ mod tests {
67026680
);
67036681
}
67046682

6705-
#[ignore]
67066683
#[test]
67076684
fn test_auto_calc_total_collateral_with_assets() {
67086685
let mut tx_builder = create_reallistic_tx_builder();

0 commit comments

Comments
 (0)