IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
33 stars 13 forks source link

Future proof against `TxBodyContent` extensions #784

Closed smelc closed 1 month ago

smelc commented 1 month ago

We could also pattern match on TxBodyContent so GHC complains.

_Originally posted by @Jimbo4350 in https://github.com/IntersectMBO/cardano-api/pull/543#discussion_r1631093502_

Context

When we add new fields in TxBodyContent, we need to think whether we want to include them in transaction view. Pattern matching on TxBodyContent list of fields will make GHC emit a warning in the JSON implementation of transaction view, hence forcing us to think about what to do. This will avoid to do PRs like https://github.com/IntersectMBO/cardano-cli/issues/711 after the fact.