Merge pull request #5684 from IntersectMBO/f-f/remove-unused-from-to-cbor
Remove unused FromCBOR/ToCBOR instances
Remove unused FromCBOR/ToCBOR instances
Client feedback: on most Rosetta chains decimals is a native, mandatory
field on every asset — and on Cardano we need to enrich it via assets-ext
even when the rest of the token-registry metadata isn't exposed. So the
flag shouldn't gate DB access; it should gate only the extra enrichment
fields in currency.metadata.
New wire contract:
- currency.decimals — always populated (CIP-26/CIP-68 value or 0 fallback)
- currency.metadata.policyId — always populated
- currency.metadata.{subject,name,description,ticker,url,logo,version}
— only when TOKEN_REGISTRY_ENABLED=true
Code changes:
- TokenQueryServiceImpl drops the enabled short-circuit and always
queries the assets-ext tables; mergeMetadata seeds decimals=0 and
always populates policyId + subject.
- TokenRegistryCurrencyData.decimals back to @Nonnull Integer.
- AccountMapperUtil / TransactionMapperUtils drop the
getDecimalsWithFallback helper and inline metadata.getDecimals().
- DataMapper injects TOKEN_REGISTRY_ENABLED; when false it emits a
policyId-only CurrencyMetadataResponse, when true it delegates to
TokenRegistryMapper for the full mapping. Decimals continues to flow
to CurrencyResponse.decimals unconditionally.
Tests:
- DataMapperTest gains a TokenRegistryEnabledFlagTests nested class
covering both flag states and null-metadata input.
- AccountMapperUtilTest and TransactionMapperUtilsTest flip the flag on
at construction since they assert on enrichment fields.
- TokenQueryServiceTest drops the RegistryEnabledFlagTests class and
updates the 'nothing found' assertions to match the new contract
(subject populated, decimals=0).
Env and docs:
- New .env.docker-compose-preview (NETWORK=preview, PROTOCOL_MAGIC=2,
enrichment + logos on). Allow-listed in .gitignore.
- token-metadata.md rewritten to separate 'decimals always' from
'enrichment gated'; per-network defaults table (mainnet off,
preprod/preview on).
- env-vars.md, helm-values.md, kubernetes/deployment.md updated to
reflect the new semantics.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Test backwards compatibility of snapshot decoders
cardano: fix local devnet staking genesis keyHash
This reverts commit 7c3ab9fb9e1e9bf64be27e71bf3b77828f9a827d.