@@ -259,6 +259,7 @@ type AllegraTransaction struct {
259259 Body AllegraTransactionBody
260260 WitnessSet shelley.ShelleyTransactionWitnessSet
261261 TxMetadata common.TransactionMetadatum
262+ RawAuxData []byte // Raw auxiliary data bytes (includes scripts)
262263}
263264
264265func (t * AllegraTransaction ) UnmarshalCBOR (cborData []byte ) error {
@@ -282,8 +283,10 @@ func (t *AllegraTransaction) UnmarshalCBOR(cborData []byte) error {
282283 return fmt .Errorf ("failed to decode transaction witness set: %w" , err )
283284 }
284285 // Handle metadata (component 3, index 2) - always present, but may be CBOR nil
285- // DecodeAuxiliaryDataToMetadata already preserves raw bytes via DecodeMetadatumRaw
286- if len (txArray ) > 2 && len (txArray [2 ]) > 0 {
286+ // Store raw auxiliary data bytes (including any scripts)
287+ if len (txArray ) > 2 && len (txArray [2 ]) > 0 && txArray [2 ][0 ] != 0xF6 { // 0xF6 is CBOR null
288+ t .RawAuxData = []byte (txArray [2 ])
289+ // Also extract metadata
287290 metadata , err := common .DecodeAuxiliaryDataToMetadata (txArray [2 ])
288291 if err == nil && metadata != nil {
289292 t .TxMetadata = metadata
@@ -393,6 +396,10 @@ func (t *AllegraTransaction) Metadata() common.TransactionMetadatum {
393396 return t .TxMetadata
394397}
395398
399+ func (t * AllegraTransaction ) RawAuxiliaryData () []byte {
400+ return t .RawAuxData
401+ }
402+
396403func (t AllegraTransaction ) IsValid () bool {
397404 return true
398405}
0 commit comments