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

PSET Examples broken #156

Open
stevenroose opened this issue Nov 21, 2022 · 9 comments
Open

PSET Examples broken #156

stevenroose opened this issue Nov 21, 2022 · 9 comments

Comments

@stevenroose
Copy link
Member

It seems that the examples are broken on master. Running this produces various compilation errors:

cargo test --features serde
@apoelstra
Copy link
Member

Can you quote the error messages? That command runs cleanly for me and it is run in CI, which has also passed recently.

@stevenroose
Copy link
Member Author

Hmm, came here to report this again, but probably different broken. The PSET ones are broken now. Many errors about private fields:

Some errors have detailed explanations: E0308, E0433, E0599, E0609, E0616.
For more information about an error, try `rustc --explain E0308`.
error[E0616]: field `inputs` of struct `elements::pset::PartiallySignedTransaction` is private
   --> examples/pset.rs:298:10
    |
298 |     pset.inputs[0].partial_sigs.clear();
    |          ^^^^^^ private field
    |
help: a method `inputs` also exists, call it with parentheses
    |
298 |     pset.inputs()[0].partial_sigs.clear();
    |                ++

error[E0616]: field `inputs` of struct `elements::pset::PartiallySignedTransaction` is private
   --> examples/pset.rs:299:10
    |
299 |     pset.inputs[0].final_script_witness = Some(vec![
    |          ^^^^^^ private field

@stevenroose stevenroose changed the title Examples broken PSET Examples broken Aug 2, 2023
@sanket1729
Copy link
Member

Hmm, this should definitely be added to the CI.

@apoelstra
Copy link
Member

Yes, and I need to figure out how to run the examples in my local CI.

I think we want to add --all-targets to our cargo test invocations.

@delta1
Copy link
Member

delta1 commented Aug 2, 2023

@apoelstra I think they are run as part of test.sh ? or does your local CI not use that script

@apoelstra
Copy link
Member

@delta1 no, my local CI uses nix so that I can reuse all the dependencies' builds across runs. cargo rebuilds the world every time.

@delta1
Copy link
Member

delta1 commented Aug 2, 2023

cool.. maybe a postCheck that calls run-parts ?

@apoelstra
Copy link
Member

apoelstra commented Aug 2, 2023

I guess you mean using run-parts to call the contrib scripts? No, because the contrib scripts call cargo which will rebuild the world and take 10x as long.

I think to run examples I would need nix-community/crate2nix#284 -- it looks like there is a draft PR open so I can crib code from that.

Edit ah, you mean to run run-parts ./target/debug/examples as is done in contrib/test.sh ... lemme see if that'll work, it would be super easy and nice if it would..

@apoelstra
Copy link
Member

It looks like the target/debug/examples directory isn't created. I think I would need to modify crate2nix.

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

No branches or pull requests

4 participants