Skip to content

Add ToJSON/FromJSON instances for EraTxWits#5854

Draft
koslambrou wants to merge 3 commits into
koslambrou/eratxauxdata-jsonfrom
koslambrou/eratxcert-json
Draft

Add ToJSON/FromJSON instances for EraTxWits#5854
koslambrou wants to merge 3 commits 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 3 times, most recently from e9dee9e to c7303f1 Compare May 22, 2026 15:31
@koslambrou koslambrou force-pushed the koslambrou/eratxauxdata-json branch from e45b5a9 to 9e0e501 Compare May 26, 2026 19:28
@koslambrou koslambrou force-pushed the koslambrou/eratxcert-json branch 2 times, most recently from 7c41159 to 5c51419 Compare May 27, 2026 13:21
@koslambrou koslambrou force-pushed the koslambrou/eratxauxdata-json branch from 9e0e501 to 23d01ed Compare May 27, 2026 13:21
* Add ToJSON/FromJSON as superclass constraints to EraScript
* Add ToJSON/FromJSON instances for MultiSig, Timelock and DijkstraNativeScript
* Add structured JSON serialisation for native scripts across all eras (Shelley, Allegra, Dijkstra)
* Add ToJSON/FromJSON instances for AlonzoScript with structured JSON format
* Rename kindObject (returning Value) to kindObjectValue; add new kindObject returning Aeson.Object
* Fix shelleyBasedEraNativeScriptToJSON and sizedNativeScriptGens to accept a child continuation to correctly handle nested scripts across eras
* Add round-trip JSON property tests for NativeScript and Script to the shared era spec
* Add ToJSON/FromJSON and NFData as EraTxAuxData superclass constraints
* Add ToJSON/FromJSON for Metadatum
* Add ToJSON/FromJSON for Data era and PlutusBinary
* Add FromJSON for PoolCert, ConwayGovCert, DijkstraDelegCert, DijkstraTxCert era
* Add ToJSON/FromJSON for ShelleyTxAuxData, AllegraTxAuxData, AlonzoTxAuxData
* Add round-trip JSON property test for TxAuxData era
* 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/eratxauxdata-json branch from 23d01ed to 49f20df Compare June 11, 2026 19:25
@koslambrou koslambrou force-pushed the koslambrou/eratxcert-json branch from 5c51419 to 92c2702 Compare June 11, 2026 19:25
@koslambrou koslambrou force-pushed the koslambrou/eratxauxdata-json branch from 49f20df to e8b24e2 Compare June 24, 2026 14:22
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