Skip to content

Commit 32d9713

Browse files
authored
Merge pull request #485 from blinklabs-io/feat/cbor-constructor-decode-store
feat: save original CBOR for Constructor
2 parents 5c4f70f + 6b727dd commit 32d9713

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cbor/value.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ func generateAstJson(obj interface{}) ([]byte, error) {
239239
}
240240

241241
type Constructor struct {
242+
DecodeStoreCbor
242243
constructor uint
243244
value *Value
244245
}
@@ -268,6 +269,8 @@ func (c Constructor) FieldsCbor() []byte {
268269
}
269270

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

0 commit comments

Comments
 (0)