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

elementsd-tests: tx_issuance test fails with new elementsd versions #214

Open
LeoComandini opened this issue Aug 23, 2024 · 0 comments
Open

Comments

@LeoComandini
Copy link
Contributor

This passes (elements 21)

rust-elements/elementsd-tests$ ELEMENTSD_EXE=bin/elementsd cargo test -- tx_issuance

This fails

ELEMENTSD_EXE=~/dev/bin/elements-23.2.1/bin/elementsd cargo test -- tx_issuance

with

error JSON-RPC error: RPC error response: RpcError { code: -4, message: "Unable to create an asset surjection proof", data: None } while calling walletprocesspsbt with ...

After applying this diff (make issuance explicit)

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},

This fails (elements 21)

rust-elements/elementsd-tests$ ELEMENTSD_EXE=bin/elementsd cargo test -- tx_issuance

with

error JSON-RPC error: RPC error response: RpcError { code: -4, message: "Unable to create an asset surjection proof", data: None } while calling walletprocesspsbt with ...

And this passes

ELEMENTSD_EXE=~/dev/bin/elements-23.2.1/bin/elementsd cargo test -- tx_issuance

Anyway this is a elementsd issue related to createpsbt/walletprocesspsbt, so AFAICT on the rust-elements side we can just apply/not apply the diff depending on the version used

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

1 participant