Skip to content

Commit

Permalink
feat: add MarshalCBOR method for TxOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
gummy789j committed May 17, 2024
1 parent aebae4b commit b2f54dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit b2f54dd

Please sign in to comment.