From b2f54dda6a980ae53542b6d9172feb9f50881b51 Mon Sep 17 00:00:00 2001 From: Steven Lin Date: Fri, 17 May 2024 09:09:42 +0800 Subject: [PATCH] feat: add MarshalCBOR method for TxOutput --- tx.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tx.go b/tx.go index 3f8c359..060a2a9 100644 --- a/tx.go +++ b/tx.go @@ -116,6 +116,11 @@ func (t TxOutput) String() string { return fmt.Sprintf("{Address: %v, Amount: %v}", t.Address, t.Amount) } +func (t TxOutput) MarshalCBOR() ([]byte, error) { + type rawTxOutput TxOutput + return cborEnc.Marshal(rawTxOutput(t)) +} + type TxBody struct { Inputs []*TxInput `cbor:"0,keyasint"` Outputs []*TxOutput `cbor:"1,keyasint"`