Skip to content

Commit 6a3d451

Browse files
committed
fix: panic on unknown utxo failure error
1 parent 91b9815 commit 6a3d451

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

ledger/error.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package ledger
22

33
import (
44
"fmt"
5+
56
"github.com/blinklabs-io/gouroboros/cbor"
67
)
78

@@ -222,7 +223,7 @@ func (e *UtxowFailure) Error() string {
222223
type UtxoFailure struct {
223224
cbor.StructAsArray
224225
Era uint8
225-
Err UtxoFailureError
226+
Err error
226227
}
227228

228229
func (e *UtxoFailure) UnmarshalCBOR(data []byte) error {
@@ -267,7 +268,7 @@ func (e *UtxoFailure) UnmarshalCBOR(data []byte) error {
267268
return fmt.Errorf("failed to parse UtxoFailure: %s", err)
268269
}
269270
}
270-
e.Err = newErr.(UtxoFailureError)
271+
e.Err = newErr.(error)
271272
return nil
272273
}
273274

@@ -276,18 +277,11 @@ func (e *UtxoFailure) Error() string {
276277
return fmt.Sprintf("UtxoFailure (FromAlonzoUtxoFail (%s))", e.Err)
277278
}
278279

279-
type UtxoFailureError interface {
280-
error
281-
isUtxoFailureError()
282-
}
283-
284280
type UtxoFailureErrorBase struct {
285281
cbor.StructAsArray
286282
Type uint8
287283
}
288284

289-
func (e *UtxoFailureErrorBase) isUtxoFailureError() {}
290-
291285
type BadInputsUtxo struct {
292286
UtxoFailureErrorBase
293287
Inputs []TxIn

0 commit comments

Comments
 (0)