Skip to content
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

More integration #98

Merged

Conversation

uncomputable
Copy link
Collaborator

Refactor the existing harness for integration tests. Write tests for all programs that currently run on Elements. The other programs require more pruning than rust-simplicity currently does.

Use the new scribe and resolve a long outstanding FIXME.
@apoelstra
Copy link
Contributor

CI failure is real.

Make crate::witness private, since crate::witness::WitnessValues is
already exported. This will break some of my existing code.
common/test.rs: The TestCase struct holds all the data that is necessary
to run an integration test. Test cases can be constructed via a builder
pattern. At the moment, there is a runtime error if necessary data is
missing. This could be changed in the future via marker types, but for
simplicity sake we don't do so in this commit.

common/util.rs: Functions for computing Simfony witness data. At the
moment, we use insecure 32-bit secure keys inside our Simfony programs.
We will upgrade to secure keys once we are able to parameterize values
such as public keys that are used inside Simfony programs.

spend_utxos.rs: The actual integration tests, which are executed in
three phases:
1) All tests create a UTXO
2) Enough blocks are mined so the lock time of each test is satisfied
3) All tests try to spend their UTXO
This pattern is possible thanks to the monotonicity of time locks,
meaning that if a time lock is satisfied at a certain block height,
it will remain satisfied in future blocks.
Witness data is dynamically generated, based on sighashes. We no longer
need to parse witness JSON files.
Copy link
Contributor

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK b432de5 successfully ran local tests; nice! I did not run the new integration tests locally.

@apoelstra apoelstra merged commit 2d5e1b1 into BlockstreamResearch:master Oct 15, 2024
11 checks passed
@uncomputable uncomputable deleted the 2024-10-more-integration branch October 16, 2024 15:51
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.

2 participants