Skip to content

Commit

Permalink
feat: save original CBOR for Constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
agaffney committed Jan 31, 2024
1 parent 5c4f70f commit 6b727dd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cbor/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ func generateAstJson(obj interface{}) ([]byte, error) {
}

type Constructor struct {
DecodeStoreCbor
constructor uint
value *Value
}
Expand Down Expand Up @@ -268,6 +269,8 @@ func (c Constructor) FieldsCbor() []byte {
}

func (c *Constructor) UnmarshalCBOR(data []byte) error {
// Save original CBOR
c.SetCbor(data)
// Parse as a raw tag to get number and nested CBOR data
tmpTag := RawTag{}
if _, err := Decode(data, &tmpTag); err != nil {
Expand Down

0 comments on commit 6b727dd

Please sign in to comment.