rust-bitcoin / rust-bitcoin/rust-miniscript

conflict_tests_from_alloy in miniscript/ms_tests.rs does not actually test for timelock mixing

Open
#514 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
426
Forks
200
Avg merge
7d 17h
Merged PRs (30d)
8

Description

File: https://github.com/rust-bitcoin/rust-miniscript/blob/a0648b3a4d63abbe53f621308614f97f04a04096/src/miniscript/ms_tests.rs (the file is too large to link directly to the test function).

It seems the test vectors in the conflict_tests_from_alloy test all contain timelock mixing for after. It seems as if the test would check for that by the absence of the k type property in the expected types, but this property is never added, even for expressions that do not contain any timelock mixing.

It seems to me that that impl fmt::Display for TestType should add k if there is no timelock mixing and add this type property to all tests in the file where it applies.

Maybe I misunderstand this test - if so, please let me know.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/miniscript/ms_tests.rs at conflict_tests_from_alloy and inspect how impl fmt::Display for TestType renders type properties. Compare the test vectors with cases that do and do not mix after timelocks, then run the relevant miniscript tests. Done means the test distinguishes timelock mixing instead of accepting identical expected properties.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.