-
Notifications
You must be signed in to change notification settings - Fork 33
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
upgrade to bitcoin 0.32 #209
Conversation
The policy in this crate is "do whatever works" to get So yes, your proposal sounds good to me. If it turns out to be unusable downstream for some reason then we can iterate a bit. |
For readers who aren't familiar with the gory details of this codebase,
That last bullet point isn't quite true: alternately, we could drop the Actually maybe @RCasatta you want to try that? Replacing |
I am going to try |
4269728 apply tomlfmt to Cargo.toml (Riccardo Casatta) e9a90cc apply rustfmt to encode.rs (Riccardo Casatta) 6789492 apply rustfmt to pset/raw.rs (Riccardo Casatta) 8ae550b apply rustfmt to src/blind.rs (Riccardo Casatta) 084f7d4 Avoid instantiating base58 errors in Address::from_base58 (Riccardo Casatta) 5eefe85 apply rustfmt to address.rs (Riccardo Casatta) Pull request description: This is propedeutic to upgrade to bitcoin 0.32 #209 where the base58 error variant specific to address are removed Also it applies formatting around on which I think we agreed upon, but also on the toml file which I had doubt, let me know if I have to remove it ACKs for top commit: apoelstra: ACK 4269728 successfully ran local tests Tree-SHA512: 0cdc7077d4ec4550a4df6f5e6eb244c7a8c0793b507c9a4327b30bdaf9f597df0dee7c72e33414df0a87cb10f9a9be12588c9a564d71cb308564cf0226b7dec1
I did some initial work here 8ce9c35 But we still need something similar to |
PSET has its own |
2d52f75
to
0ff64eb
Compare
…able c08382c Copy ReadExt/WriteExt from bitcoin (Riccardo Casatta) 4aad862 Stop implementing elements::Encodable with bitcoin::Encodable (Riccardo Casatta) Pull request description: Following bitcoin versions change `io` with `bitcoin_io`, upgrading would then require changing also elements::Encodable to match. Instead, we are re-implementing what is needed. Makes #209 easier ACKs for top commit: apoelstra: ACK c08382c successfully ran local tests; a bit redundant but I think this is the right way to go Tree-SHA512: e849dc141ab412f1db3539a132688b28e2770befb8fc46e64d3396f16c3b9035bb7d76a0813d4d7bf65ff85df418cb42e8d75e01d1db7879c5853dd40214e053
still needing something along the lines of ElementsProject/elements-miniscript#88 |
Integration testing is now passing but testing locally with elements Elements Core version v23.2.1 I hit an error: [nix-shell:~/git/rust-elements/elementsd-tests]$ elementsd --version
Elements Core version v23.2.1
[nix-shell:~/git/rust-elements/elementsd-tests]$ cargo test -- tx_issuance
Finished test [unoptimized + debuginfo] target(s) in 0.16s
Running unittests src/lib.rs (/home/casatta/git/rust-elements/target/debug/deps/elementsd_tests-534535ebc6e90ec9)
running 1 test
test pset::tx_issuance ... FAILED
failures:
---- pset::tx_issuance stdout ----
thread 'pset::tx_issuance' panicked at elementsd-tests/src/lib.rs:37:23:
error JSON-RPC error: RPC error response: RpcError { code: -4, message: "Unable to create an asset surjection proof", data: None } while calling walletprocesspsbt with [String("cHNldP8BAgQCAAAAAQMEAAAAAAEEAQEBBQEEAfsEAgAAAAABDiAIe20YE7qmV3wszCrvpMzUqdI8fWWYRhP0/w9AOl/MkQEPBAAAAAABEAT/////B/wEcHNldAAIAOh2SBcAAAAH/ARwc2V0CggA4fUFAAAAAAABAwgA6HZIFwAAAAEEFgAUIG3HsMlrrmBZ2Z/fkew6jvzw8cQH/ARwc2V0AiCMtTvaweODNVnCoPh80OQHJ7w4kxJ5N65WAfoFAJK0eAf8BHBzZXQGIQNwqIVVbZjBP3WbfM2Q8rAf+UgZ18FXTFz63sjjROxbSwf8BHBzZXQIBAAAAAAAAQMIAOH1BQAAAAABBBYAFOQA+B8RK4Xe3KZuDBdXMUH8TdKBB/wEcHNldAIg+wI9yyBNBZ8YSEWrxZOS/GiW+fnJqyUNM5YkNyoWVXYH/ARwc2V0BiECsxS+LIBwaCdgZNH/FvEcvBsFUfRkMB7K4CviLIwcRUsH/ARwc2V0CAQAAAAAAAEDCIDeknwAAAAAAQQWABTCiuEQ1wJ5ohJXRzHqxwXhaEAAMwf8BHBzZXQCICWyUQcOKcoZBDzzPM1zJOLdqwPsxK4LXnfE/A5c9slaB/wEcHNldAYhAweZZvsyOP39XpkGG0xIH5QZsB2o3GC4rAhnpG4dF7ffB/wEcHNldAgEAAAAAAABAwiAlpgAAAAAAAEEAAf8BHBzZXQCICWyUQcOKcoZBDzzPM1zJOLdqwPsxK4LXnfE/A5c9slaAA==")]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace |
reproduced the asset surjection proof error with elementsd v22.1.1 and v23.2.2 it does not happen with elementsd v0.21.0.3 |
Making the issuance unblinded fixes the issue diff --git a/elementsd-tests/src/pset.rs b/elementsd-tests/src/pset.rs
index dd2d92b..6c475b0 100644
--- a/elementsd-tests/src/pset.rs
+++ b/elementsd-tests/src/pset.rs
@@ -55,12 +55,12 @@ fn tx_issuance() {
let contract_hash = ContractHash::from_byte_array([0u8; 32]);
let entropy = AssetId::generate_asset_entropy(prevout, contract_hash);
let asset_id = AssetId::from_entropy(entropy.clone());
- let reissuance_id = AssetId::reissuance_token_from_entropy(entropy, true);
+ let reissuance_id = AssetId::reissuance_token_from_entropy(entropy, false);
let value = elementsd.call(
"createpsbt",
&[
- json!([{ "txid": prevout.txid.to_string(), "vout": prevout.vout, "issuance_amount": 1000, "issuance_tokens": 1}]),
+ json!([{ "txid": prevout.txid.to_string(), "vout": prevout.vout, "issuance_amount": 1000, "issuance_tokens": 1, "blind_reissuance": false}]),
json!([
{address_asset: "1000", "asset": asset_id.to_string(), "blinder_index": 0},
{address_reissuance: "1", "asset": reissuance_id.to_string(), "blinder_index": 0}, In the end this is a |
utACK 61091a7, code review |
Can you squash the first two commits together? The test crate doesn't compile with the first one due to version mismatches. |
avoid setting {BITCOIND,ELEMENTSD}_EXE in setup The logic of setting the env var inside the setup prevents user of other OS like nixos to run the tests (because the included binary are not working on nixos). Setting those env vars is meant to be done in the dev environment not in the code. With this users with `bitcoind` and `elementsd` in their PATH will work too. The CI script will set the variables only if they are not already set. (Allowing Nixos users to override and run it locally)
First two commits squashed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f889525 successfully ran local tests
Edited PR description to remove crossed out text, since it didn't seem essential and because it @-referenced me, which the merge script did not like. |
#208
We went for not depending on bitcoin::Encodable instead