Closed roconnor-blockstream closed 7 months ago
primitive/elements/jets.c: In function 'input_utxo_hash':
primitive/elements/jets.c:1110:17: error: declaration of 'utxo' shadows a global declaration [-Werror=shadow]
1110 | const utxo* utxo = &env->tx->input[i].txo;
| ^~~~
In file included from primitive/elements/ops.h:7,
from primitive/elements/jets.c:3:
primitive/elements/primitive.h:138:3: note: shadowed declaration is here
138 | } utxo;
| ^~~~
@apoelstra This is ready for your review.
LGTM.
Two observations:
Looks like primitiveEnumJet.inc
is not updated
++++ diff primitiveEnumJet.inc /nix/store/571z6kp50kw0x4v2x5vsgg3qk4qqp4jl-source/C/primitive/elements/primitiveEnumJet.inc
174a175
> INPUT_HASH,
183a185
> INPUT_UTXO_HASH,
201a204
> ISSUANCE_HASH,
329a333
> OUTPUT_HASH,
Should be fixed now.
The
tx-hash
and*-hash
jets for Elements transactions generally hash parts of the transaction across all input and or outputs. This lets you do something like CTV and APO. However, for covenants you typically want to hash all the data that corresponds to a specific input or specific output.input-hash : TWO^32 ⊢ S(TWO^256)
Similar toinputs-hash
but only hashing the data of one input.output-hash : TWO^32 ⊢ S(TWO^256)
Similar tooutputs-hash
but only hashing the data of one output.issuance-hash : TWO^32 ⊢ S(TWO^256)
Similar toissuances-hash
but only hashing the data of one input.input-utxo-hash : TWO^32 ⊢ S(TWO^256)
Similar toinputs-utxos-hash
but only hashing the data of one input.This PR refactors some of the existing jet specifications changing their CMRs.