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

Conversation

ImplOfAnImpl
Copy link
Contributor

@ImplOfAnImpl ImplOfAnImpl commented Jul 1, 2025

The current tests in mintscript are rather hard to maintain because the expected values are in separate files with not very descriptive names.
In this PR I've put the expected values directly into the code and removed the files.

The tests can still be improved though (e.g. it'd be better if the expected values were Rust objects instead of their string representations), I've left a TODO about it.

Edit:

  1. there was also a test failure in input_commitments::order_fill test in the chainstate test suite, due to a low initial amount being generated (not enough to do 2 fills), I fixed it here by increasing the amounts and also did the same in another similar test.
  2. there was also another clippy 1.88 failure due to a large enum variant.

@ImplOfAnImpl ImplOfAnImpl force-pushed the sighash_input_commitments branch from 2db311e to 563511e Compare July 2, 2025 18:24
@ImplOfAnImpl ImplOfAnImpl force-pushed the refactor_mintscript_tests branch from a7ff4ac to 38c1fbe Compare July 2, 2025 18:34
Base automatically changed from sighash_input_commitments to master July 3, 2025 07:59
@ImplOfAnImpl ImplOfAnImpl force-pushed the refactor_mintscript_tests branch from a3b88e0 to 3bb8f12 Compare July 3, 2025 08:29
@ImplOfAnImpl ImplOfAnImpl force-pushed the refactor_mintscript_tests branch from 3bb8f12 to e4878c0 Compare July 8, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant