Skip to content

Commit

Permalink
ormolu
Browse files Browse the repository at this point in the history
  • Loading branch information
polinavino committed Jan 5, 2021
1 parent f6944f6 commit a49b709
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
16 changes: 10 additions & 6 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/TxBody.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ViewPatterns #-}

Expand All @@ -38,15 +38,15 @@ module Cardano.Ledger.Alonzo.TxBody
)
where

import qualified Cardano.Crypto.Hash as Hash
import Cardano.Ledger.Crypto (HASH)
import Cardano.Binary (FromCBOR (..), ToCBOR (..))
import qualified Cardano.Crypto.Hash as Hash
import Cardano.Ledger.Alonzo.Data (DataHash)
import Cardano.Ledger.Alonzo.Scripts (ExUnits)
import Cardano.Ledger.Alonzo.TxWitness (ScriptDataHash)
import Cardano.Ledger.AuxiliaryData (AuxiliaryDataHash)
import Cardano.Ledger.Compactible
import qualified Cardano.Ledger.Core as Core
import Cardano.Ledger.Crypto (HASH)
import qualified Cardano.Ledger.Crypto as CC
import Cardano.Ledger.Era (Crypto, Era)
import Cardano.Ledger.Mary.Value (Value)
Expand Down Expand Up @@ -348,14 +348,18 @@ instance CC.Crypto crypto => FromCBOR (TxIn crypto) where
fromCBOR = decode $ RecD TxInCompact <! From <! From <! From

instance
(Era era,
ToCBOR (CompactForm (Core.Value era))) =>
( Era era,
ToCBOR (CompactForm (Core.Value era))
) =>
ToCBOR (TxOut era)
where
toCBOR (TxOutCompact addr cv dh) =
encode $
Rec @(CompactAddr (Crypto era) -> CompactForm (Core.Value era) -> StrictMaybe (DataHash (Crypto era)) -> TxOut era)
TxOutCompact !> To addr !> To cv !> To dh
TxOutCompact
!> To addr
!> To cv
!> To dh

instance
( Era era,
Expand Down
3 changes: 1 addition & 2 deletions alonzo/impl/src/Cardano/Ledger/Alonzo/TxWitness.hs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ instance
. unScriptDataConstr
$ _witsScriptData m

instance
HasField "witsRdmrs" (TxWitness era) (Map RdmrPtr (Data era)) where
instance HasField "witsRdmrs" (TxWitness era) (Map RdmrPtr (Data era)) where
getField (TxWitnessConstr (Memo m _)) =
_scriptDataRdmrs
. memotype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import Cardano.Ledger.Alonzo.Scripts
import Cardano.Ledger.Alonzo.Tx
import Cardano.Ledger.Alonzo.TxBody
( IsFee (..),
PPHash (..),
TxBody (TxBody),
TxIn (..),
TxOut (..),
PPHash (..)
)
import Cardano.Ledger.Alonzo.TxWitness
import qualified Cardano.Ledger.Core as Core
Expand Down

0 comments on commit a49b709

Please sign in to comment.