Skip to content

Add ToJSON/FromJSON instances for EraTxWits#5854

Draft
koslambrou wants to merge 1 commit into
koslambrou/eratxauxdata-jsonfrom
koslambrou/eratxcert-json
Draft

Add ToJSON/FromJSON instances for EraTxWits#5854
koslambrou wants to merge 1 commit into
koslambrou/eratxauxdata-jsonfrom
koslambrou/eratxcert-json

Conversation

@koslambrou
Copy link
Copy Markdown
Contributor

Description

  • Add ToJSON, FromJSON and NFData as EraTxWits superclass constraints
  • Add ToJSON/FromJSON for WitVKey, BootstrapWitness
  • Add ToJSONKey/FromJSONKey for AccountId
  • Add ToJSON/FromJSON for Inclusive and Exclusive
  • Add FromJSON for TxIn; fix txInToText to use unTxIx
  • Add FromJSON for PoolCert
  • Add ToJSON/FromJSON for ShelleyTxWits era
  • Add FromJSON for AsIx, AlonzoPlutusPurpose AsIx, TxDats, Redeemers, AlonzoTxWits
  • Add FromJSON for ConwayDelegCert, ConwayGovCert, ConwayTxCert era, ConwayPlutusPurpose
  • Add FromJSON for GovActionId, Voter, Vote, VotingProcedure, ProposalProcedure, GovAction, GovPurposeId
  • Add ToJSON/FromJSON for AccountBalanceInterval, DijkstraScript
  • Add FromJSON for DijkstraDelegCert, DijkstraTxCert era
  • Add round-trip JSON property test for TxWits era

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

instance ToJSONKey TxIn where
toJSONKey = toJSONKeyText txInToText

instance FromJSON TxIn where
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comes from cardano-api's way of JSON serializing the TxIn

@koslambrou koslambrou force-pushed the koslambrou/eratxcert-json branch 2 times, most recently from 5d45a1c to 21f6224 Compare May 21, 2026 12:36
@koslambrou koslambrou force-pushed the koslambrou/eratxauxdata-json branch from 6795448 to 547933d Compare May 21, 2026 15:26
@koslambrou koslambrou force-pushed the koslambrou/eratxcert-json branch from 21f6224 to d31f458 Compare May 21, 2026 15:27
@koslambrou koslambrou force-pushed the koslambrou/eratxauxdata-json branch 2 times, most recently from f654838 to e45b5a9 Compare May 22, 2026 15:02
@koslambrou koslambrou force-pushed the koslambrou/eratxcert-json branch 2 times, most recently from 52b3c77 to e9dee9e Compare May 22, 2026 15:30
* Add ToJSON, FromJSON and NFData as EraTxWits superclass constraints
* Add ToJSON/FromJSON for WitVKey, BootstrapWitness
* Add ToJSONKey/FromJSONKey for AccountId
* Add ToJSON/FromJSON for Inclusive and Exclusive
* Add FromJSON for TxIn; fix txInToText to use unTxIx
* Add FromJSON for PoolCert
* Add ToJSON/FromJSON for ShelleyTxWits era
* Add FromJSON for AsIx, AlonzoPlutusPurpose AsIx, TxDats, Redeemers, AlonzoTxWits
* Add FromJSON for ConwayDelegCert, ConwayGovCert, ConwayTxCert era, ConwayPlutusPurpose
* Add FromJSON for GovActionId, Voter, Vote, VotingProcedure, ProposalProcedure, GovAction, GovPurposeId
* Add ToJSON/FromJSON for AccountBalanceInterval, DijkstraScript
* Add FromJSON for DijkstraDelegCert, DijkstraTxCert era
* Add round-trip JSON property test for TxWits era
@koslambrou koslambrou force-pushed the koslambrou/eratxcert-json branch from e9dee9e to c7303f1 Compare May 22, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant