blinklabs-io / gouroboros

Go implementation of the Cardano Ouroboros family of protocols
Apache License 2.0
68 stars 12 forks source link

Migrate CBOR constructor/alternative support from cbor.Value to generic encoder/decoder #550

Open agaffney opened 7 months ago

agaffney commented 7 months ago

This is trickier than the simple types since there are multiple ranges of tag numbers that map to constructor indexes. We can probably get rid of cbor.Value all together after this, but we'll probably want to keep cbor.LazyValue, or at least its deferred parsing ability.

There doesn't seem to be a way to use TagSet.Add() in a way that allows using multiple tag numbers with a single object type while being able to preserve the original tag number. This doesn't leave us with many options, and probably not any good ones.

agaffney commented 7 months ago

I created the upstream issue https://github.com/fxamacker/cbor/issues/508 for this