From 20c9e7f5fc7bde060c5caeaf3444545d716f0382 Mon Sep 17 00:00:00 2001 From: Salvionied Date: Sat, 24 Aug 2024 13:59:27 +0200 Subject: [PATCH] change script_data_hash calculation --- txBuilding/TxBuilder/TxBuilder.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/txBuilding/TxBuilder/TxBuilder.go b/txBuilding/TxBuilder/TxBuilder.go index 8ec1601..afa689e 100644 --- a/txBuilding/TxBuilder/TxBuilder.go +++ b/txBuilding/TxBuilder/TxBuilder.go @@ -435,13 +435,14 @@ func ScriptDataHash(witnessSet TransactionWitnessSet.TransactionWitnessSet) (*se cost_models = PlutusData.COST_MODELSV2 } } + var redeemer_bytes []byte + if redeemers == nil { - redeemers = []Redeemer.Redeemer{} - } - redeemer_bytes, err := cbor.Marshal(redeemers) - if err != nil { - return nil, err + redeemer_bytes, _ = hex.DecodeString("A0") + } else { + redeemer_bytes, _ = cbor.Marshal(redeemers) } + var datum_bytes []byte if datums.Len() > 0 {