Create a ledger/common.Metadatum
type that can encode/decode TX metadata as specified in the CDDL:
https://github.com/IntersectMBO/cardano-ledger/blob/693218df6cd90263da24e6c2118bac420ceea3a1/eras/conway/impl/cddl-files/conway.cddl#L712-L717
This should be a single type that supports recursive encoding/decoding of the supported data structure, similar to cbor.Value
. Replace the use of cbor.LazyValue
for decoding metadata in the various per-era Transaction
types with this new type. Create some decoding tests using metadata from a few on-chain TXs.