@@ -221,9 +221,18 @@ instance ToObject (Conway.ConwayDelegPredFailure era) where
221221 , " credential" .= String (textShow credential)
222222 , " error" .= String " Delegated rep is not registered for provided stake key"
223223 ]
224- -- TODO: fix
225- Conway. DepositIncorrectDELEG _ -> undefined
226- Conway. RefundIncorrectDELEG _ -> undefined
224+ Conway. DepositIncorrectDELEG Mismatch {mismatchSupplied, mismatchExpected} ->
225+ [ " kind" .= String " DepositIncorrectDELEG"
226+ , " givenRefund" .= mismatchSupplied
227+ , " expectedRefund" .= mismatchExpected
228+ , " error" .= String " Deposit mismatch"
229+ ]
230+ Conway. RefundIncorrectDELEG Mismatch {mismatchSupplied, mismatchExpected} ->
231+ [ " kind" .= String " RefundIncorrectDELEG"
232+ , " givenRefund" .= mismatchSupplied
233+ , " expectedRefund" .= mismatchExpected
234+ , " error" .= String " Refund mismatch"
235+ ]
227236
228237instance ToObject (Set (Credential 'Staking)) where
229238 toObject _verb creds =
@@ -485,8 +494,12 @@ instance
485494 ]
486495 )
487496 (Api. shelleyBasedEra :: Api. ShelleyBasedEra era )
488- -- TODO: fix
489- toObject _ _ = undefined
497+ toObject _ (VRFKeyHashAlreadyRegistered poolId vrfKeyHash) =
498+ mconcat [ " kind" .= String " VRFKeyHashAlreadyRegistered"
499+ , " poolId" .= String (textShow poolId)
500+ , " vrfKeyHash" .= String (textShow vrfKeyHash)
501+ , " error" .= String " Pool with the same VRF Key Hash is already registered"
502+ ]
490503
491504instance
492505 ( ToObject (PredicateFailure (Core. EraRule " UTXO" ledgerera ))
@@ -815,8 +828,12 @@ instance ToObject (ShelleyPoolPredFailure era) where
815828 , " hashSize" .= String (textShow hashSize)
816829 , " error" .= String " The stake pool metadata hash is too large"
817830 ]
818- -- TODO: fix
819- toObject _verb (VRFKeyHashAlreadyRegistered _ _) = undefined
831+ toObject _ (VRFKeyHashAlreadyRegistered poolId vrfKeyHash) =
832+ mconcat [ " kind" .= String " VRFKeyHashAlreadyRegistered"
833+ , " poolId" .= String (textShow poolId)
834+ , " vrfKeyHash" .= String (textShow vrfKeyHash)
835+ , " error" .= String " Pool with the same VRF Key Hash is already registered"
836+ ]
820837
821838-- Apparently this should never happen according to the Shelley exec spec
822839 -- toObject _verb (WrongCertificateTypePOOL index) =
@@ -1183,8 +1200,12 @@ instance
11831200 mconcat [ " kind" .= String " MalformedReferenceScripts"
11841201 , " scripts" .= s
11851202 ]
1186- -- TODO: fix
1187- Babbage. ScriptIntegrityHashMismatch _ _ -> undefined
1203+ Babbage. ScriptIntegrityHashMismatch Mismatch {mismatchSupplied, mismatchExpected} mBytes ->
1204+ mconcat [ " kind" .= String " ScriptIntegrityHashMismatch"
1205+ , " supplied" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchSupplied)
1206+ , " expected" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchExpected)
1207+ , " hashHexPreimage" .= formatAsHex (mBytes)
1208+ ]
11881209
11891210instance Core. Crypto crypto => ToObject (Praos. PraosValidationErr crypto ) where
11901211 toObject _ err' =
@@ -1525,8 +1546,12 @@ instance
15251546 mconcat [ " kind" .= String " MalformedReferenceScripts"
15261547 , " scripts" .= scripts
15271548 ]
1528- -- TODO: fix
1529- Conway. ScriptIntegrityHashMismatch _ _ -> undefined
1549+ Conway. ScriptIntegrityHashMismatch Mismatch {mismatchSupplied, mismatchExpected} mBytes ->
1550+ mconcat [ " kind" .= String " ScriptIntegrityHashMismatch"
1551+ , " supplied" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchSupplied)
1552+ , " expected" .= renderScriptIntegrityHash (strictMaybeToMaybe mismatchExpected)
1553+ , " hashHexPreimage" .= formatAsHex (mBytes)
1554+ ]
15301555
15311556instance ToObject (Praos. PraosTiebreakerView crypto ) where
15321557 toObject v (Praos. PraosTiebreakerView sl issuer issueNo vrf) =
0 commit comments