Skip to content

Commit 0bd963a

Browse files
authored
Merge pull request #1934 from mintlayer/refactor_mintscript_tests
Refactor mintscript tests - put the expected output directly into the code
2 parents 896c5f5 + e4878c0 commit 0bd963a

163 files changed

Lines changed: 393 additions & 286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chainstate/test-suite/src/tests/input_commitments.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,9 @@ fn order_fill(#[case] seed: Seed, #[case] orders_version: OrdersVersion) {
356356
);
357357
let coins_left = tf.coin_amount_from_utxo(&coins_outpoint);
358358

359-
let initial_ask_amount = Amount::from_atoms(rng.gen_range(1u128..1000));
359+
let initial_ask_amount = Amount::from_atoms(rng.gen_range(10..1000));
360360
let initial_give_amount =
361-
Amount::from_atoms(rng.gen_range(1u128..=token_amount_to_mint.into_atoms()));
361+
Amount::from_atoms(rng.gen_range(10..=token_amount_to_mint.into_atoms()));
362362
let initially_asked = OutputValue::Coin(initial_ask_amount);
363363
let initially_given = OutputValue::TokenV1(token_id, initial_give_amount);
364364
let order_data = OrderData::new(
@@ -646,9 +646,9 @@ fn order_conclude(#[case] seed: Seed, #[case] orders_version: OrdersVersion) {
646646
PrivateKey::new_from_rng(&mut rng, KeyKind::Secp256k1Schnorr);
647647
let order_owner_dest = Destination::PublicKey(order_owner_pk);
648648

649-
let initial_ask_amount = Amount::from_atoms(rng.gen_range(1u128..1000));
649+
let initial_ask_amount = Amount::from_atoms(rng.gen_range(10..1000));
650650
let initial_give_amount =
651-
Amount::from_atoms(rng.gen_range(1u128..=token_amount_to_mint.into_atoms()));
651+
Amount::from_atoms(rng.gen_range(10..=token_amount_to_mint.into_atoms()));
652652
let initially_asked = OutputValue::Coin(initial_ask_amount);
653653
let initially_given = OutputValue::TokenV1(token_id, initial_give_amount);
654654
let order_data = OrderData::new(

mintscript/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ tokens-accounting = { path = "../tokens-accounting" }
1818
utils = { path = "../utils" }
1919
utxo = { path = "../utxo" }
2020

21+
ctor.workspace = true
22+
derive_more.workspace = true
2123
static_assertions.workspace = true
24+
strum.workspace = true
2225
thiserror.workspace = true
2326

2427
[dev-dependencies]

0 commit comments

Comments
 (0)