WIP - feat: Support hashed datum options for inputs and outputs#253
Open
AndrewWestberg wants to merge 1 commit intotx3-lang:mainfrom
Conversation
651375a to
aa54d50
Compare
AndrewWestberg
commented
Nov 14, 2025
| to: MyParty, | ||
| amount: source - fees, | ||
|
|
||
| // FIXME: We can't seem to reference source fields here yet. |
Author
There was a problem hiding this comment.
@scarmuega I don't understand how the system works for referencing inputs from outputs. I get an error currently when I attempt to do this.
thread 'tests::input_hashed_datum_test' (2249654) panicked at crates/tx3-cardano/src/tests.rs:107:31:
called `Result::unwrap()` on an `Err` value: PropertyIndexNotFound(0, "UtxoSet({Utxo { ref: UtxoRef { txid: [38, 122, 174, 53, 79, 13, 20, 216, 40, 119, 250, 87, 32, 247, 221, 201, 176, 227, 238, 163, 205, 42, 7, 87, 175, 119, 219, 77, 151, 91, 168, 28], index: 0 }, address: [1, 158, 56, 80, 3, 97, 138, 11, 77, 174, 227, 220, 115, 173, 230, 69, 208, 72, 166, 145, 191, 125, 171, 4, 199, 226, 106, 93, 108, 163, 154, 184, 56, 55, 113, 27, 210, 132, 208, 59, 221, 126, 30, 38, 23, 249, 254, 14, 90, 132, 37, 145, 80, 181, 239, 184, 116], datum: Some(Struct(StructExpr { constructor: 0, fields: [Number(1), Bytes([97, 98, 99])] })), assets: CanonicalAssets({Naked: 500000000}), script: None }})")
stack backtrace:
0: __rustc::rust_begin_unwind
at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/std/src/panicking.rs:698:5
1: core::panicking::panic_fmt
at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/panicking.rs:75:14
2: core::result::unwrap_failed
at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/result.rs:1855:5
3: core::result::Result<T,E>::unwrap
at /home/westbam/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1226:23
4: tx3_cardano::tests::fill_inputs
at ./src/tests.rs:107:31
5: tx3_cardano::tests::compile_tx_round
at ./src/tests.rs:122:10
6: tx3_cardano::tests::test_compile
at ./src/tests.rs:133:24
7: tx3_cardano::tests::input_hashed_datum_test::{{closure}}
at ./src/tests.rs:327:14
8: pollster::block_on
at /home/westbam/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/pollster-0.4.0/src/lib.rs:126:28
9: tx3_cardano::tests::input_hashed_datum_test
at ./src/tests.rs:301:1
10: tx3_cardano::tests::input_hashed_datum_test::{{closure}}
at ./src/tests.rs:302:35
11: core::ops::function::FnOnce::call_once
at /home/westbam/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
12: core::ops::function::FnOnce::call_once
at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR has a basic framework for creating an output that only has a datum hash and not inline datum. However, it's stuck in that I can't seem to reference source fields.
The other issue is in Pallas: txpipe/pallas#711The test transaction that gets built has no script datum hash value because there are no redeemers. This is an incorrect behavior of pallas.