diff --git a/.changeset/afraid-ads-happen.md b/.changeset/afraid-ads-happen.md new file mode 100644 index 0000000..ba2e8ef --- /dev/null +++ b/.changeset/afraid-ads-happen.md @@ -0,0 +1,5 @@ +--- +"@blaze-cardano/tx": minor +--- + +This checks the protocol version to determine if the new script data hash requirements are current yet or not. diff --git a/packages/blaze-tx/src/tx.ts b/packages/blaze-tx/src/tx.ts index 43192ae..ac59740 100644 --- a/packages/blaze-tx/src/tx.ts +++ b/packages/blaze-tx/src/tx.ts @@ -955,7 +955,9 @@ export class TxBuilder { // Initialize a CBOR writer to encode the script data. const writer = new CborWriter(); // Encode redeemers and datums into CBOR format. - if (redeemers.length === 0) { + // In the conway era, the format changes + const conway = this.params.protocolVersion.major === 9; + if (conway && redeemers.length === 0) { // An empty redeemer set is always an empty map, as of conway writer.writeStartMap(0); } else {