File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ type Value struct {
32
32
cborData string
33
33
}
34
34
35
+ func (v * Value ) MarshalCBOR () ([]byte , error ) {
36
+ // Return stored CBOR
37
+ // This is only a stopgap, since it doesn't allow us to build values from scratch
38
+ return []byte (v .cborData ), nil
39
+ }
40
+
35
41
func (v * Value ) UnmarshalCBOR (data []byte ) error {
36
42
// Save the original CBOR
37
43
v .cborData = string (data [:])
@@ -360,6 +366,12 @@ type LazyValue struct {
360
366
value * Value
361
367
}
362
368
369
+ func (l * LazyValue ) MarshalCBOR () ([]byte , error ) {
370
+ // Return stored CBOR
371
+ // This is only a stopgap, since it doesn't allow us to build values from scratch
372
+ return []byte (l .value .cborData ), nil
373
+ }
374
+
363
375
func (l * LazyValue ) UnmarshalCBOR (data []byte ) error {
364
376
if l .value == nil {
365
377
l .value = & Value {}
You can’t perform that action at this time.
0 commit comments