Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cardano-api: Drop ToJSON Script (ledger) instance #4130

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions cardano-api/src/Cardano/Api/Orphans.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import Cardano.Slotting.Time (SystemStart (..))

import qualified Cardano.Crypto.Hash.Class as Crypto
import qualified Cardano.Ledger.Alonzo.Data as Alonzo
import qualified Cardano.Ledger.Alonzo.Scripts as Alonzo
import qualified Cardano.Ledger.Babbage.PParams as Babbage
import qualified Cardano.Ledger.Babbage.TxBody as Babbage
import qualified Cardano.Ledger.Coin as Shelley
Expand All @@ -61,7 +60,6 @@ import qualified Cardano.Ledger.Shelley.Rewards as Shelley
import qualified Ouroboros.Consensus.Shelley.Eras as Consensus

import Cardano.Api.Script
import Cardano.Api.SerialiseRaw (serialiseToRawBytesHexText)

-- Orphan instances involved in the JSON output of the API queries.
-- We will remove/replace these as we provide more API wrapper types
Expand Down Expand Up @@ -241,12 +239,6 @@ instance ( Ledger.Era era
SNothing -> Aeson.Null
SJust dH -> toJSON $ ScriptDataHash dH

instance ToJSON (Alonzo.Script (Babbage.BabbageEra Consensus.StandardCrypto)) where
toJSON s = Aeson.String . serialiseToRawBytesHexText
$ ScriptHash $ Ledger.hashScript @(Babbage.BabbageEra Consensus.StandardCrypto) s



instance Crypto.Crypto crypto => ToJSON (Shelley.DPState crypto) where
toJSON dpState = object [ "dstate" .= Shelley.dpsDState dpState
, "pstate" .= Shelley.dpsPState dpState
Expand Down