Skip to content

Refactor mintscript tests - put the expected output directly into the code #1934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions chainstate/test-suite/src/tests/input_commitments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ fn order_fill(#[case] seed: Seed, #[case] orders_version: OrdersVersion) {
);
let coins_left = tf.coin_amount_from_utxo(&coins_outpoint);

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

let initial_ask_amount = Amount::from_atoms(rng.gen_range(1u128..1000));
let initial_ask_amount = Amount::from_atoms(rng.gen_range(10..1000));
let initial_give_amount =
Amount::from_atoms(rng.gen_range(1u128..=token_amount_to_mint.into_atoms()));
Amount::from_atoms(rng.gen_range(10..=token_amount_to_mint.into_atoms()));
let initially_asked = OutputValue::Coin(initial_ask_amount);
let initially_given = OutputValue::TokenV1(token_id, initial_give_amount);
let order_data = OrderData::new(
Expand Down
3 changes: 3 additions & 0 deletions mintscript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ tokens-accounting = { path = "../tokens-accounting" }
utils = { path = "../utils" }
utxo = { path = "../utxo" }

ctor.workspace = true
derive_more.workspace = true
static_assertions.workspace = true
strum.workspace = true
thiserror.workspace = true

[dev-dependencies]
Expand Down
Loading