Skip to content

Commit

Permalink
Merge pull request #600 from input-output-hk/erikd/deps-20210504
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
erikd committed May 4, 2021
2 parents 6805d61 + 511c6d4 commit ee0b4a6
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 73 deletions.
40 changes: 15 additions & 25 deletions cabal.project
Expand Up @@ -67,14 +67,15 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-base
tag: 101e7752cf4b23fd0b411736f523b8f6c43f6bc2
--sha256: 04qnq9a3mhfqsisln2sygfm0xkkvj8f8hdzxm1qn2ss0mfsfzx8y
tag: 47db5b818ca4fa051f2e44cdf5e7c5c18c1fb0bf
--sha256: 0fr0r5dwfmsp15j19xh20js8nzsqyhwx4q797rxsvpyjfabb2y11
subdir:
binary
binary/test
cardano-crypto-class
cardano-crypto-praos
slotting
strict-containers

source-repository-package
type: git
Expand All @@ -85,16 +86,16 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger-specs
tag: 0730828363ad6d0669b7a5a12635e22944b32880
--sha256: 099j8xcmhlfqz5p8qpxsxixzlb06zmxxl7yqd06dkr96gbjd2npz
tag: e8f19bcc9c8f405131cb95ca6ada26b2b4eac638
--sha256: 1v36d3lyhmadzj0abdfsppjna7n7llzqzp9ikx5yq28l2kda2f1p
subdir:
alonzo/impl
byron/chain/executable-spec
byron/crypto
byron/crypto/test
byron/chain/executable-spec
byron/ledger/executable-spec
byron/ledger/impl
byron/ledger/impl/test
cardano-ledger-core
semantics/executable-spec
semantics/small-steps-test
shelley/chain-and-ledger/dependencies/non-integer
Expand All @@ -106,8 +107,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node
tag: 324c2d83ec4b7862e5e317a341e7732fbedeeaa8
--sha256: 0gbqq8jvr7agl4ryjcvqb04w7a52d9lazaq3b1d51xa3irwa77fz
tag: e730ea84310e19e036eca382855acc4e35af717c
--sha256: 0fga83x99yw4jwany8fp6z622lydfy5blmsyflbic2cb176l1s41
subdir:
cardano-api
cardano-config
Expand All @@ -116,8 +117,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-prelude
tag: ee4e7b547a991876e6b05ba542f4e62909f4a571
--sha256: 0dg6ihgrn5mgqp95c4f11l6kh9k3y75lwfqf47hdp554w7wyvaw6
tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555
--sha256: 00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj
subdir:
cardano-prelude
cardano-prelude-test
Expand All @@ -131,8 +132,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: bf3b4336dfd202fe0b5e765cdaa97788674e456c
--sha256: 1ilq7yq8a3mpy21fiqharx7vs2b555n78gf7m48kkd0pl58vq759
tag: 808724ff8a19a33d0ed06f9ef59fbd900b08553c
--sha256: 0298dpl29gxzs9as9ha6y0w18hqwc00ipa3hzkxv7nlfrjjz8hmz
subdir:
contra-tracer
iohk-monitoring
Expand All @@ -146,8 +147,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-network
tag: 7f90c8c59ffc7d61a4e161e886d8962a9c26787a
--sha256: 0hnw6hvbyny3wniaqw8d37l4ysgp8xrq5d84fapxfm525a4hfs0x
tag: 9b279c7548ee549e1ed755cd1acb69b6e69d0c7b
--sha256: 0d7bk9vzmhhb2z4ns2qw7f1vz6lr186m98sh8wvrnfpxk3z86dxb
subdir:
cardano-client
io-sim
Expand All @@ -163,17 +164,6 @@ source-repository-package
typed-protocols-examples
network-mux

source-repository-package
type: git
location: https://github.com/input-output-hk/plutus
tag: ffc1768f5be7af66d8d745a31c9c6a77c5c55104
--sha256: 0qwj0xnvkrxsmfw883w3idfnhj073d5swcxl54zs7ay4fgwrm4c2
subdir:
plutus-core
plutus-ledger-api
plutus-tx
prettyprinter-configurable

allow-newer:
monoidal-containers:aeson,
size-based:template-haskell
2 changes: 1 addition & 1 deletion cardano-db-sync/cardano-db-sync.cabal
Expand Up @@ -75,8 +75,8 @@ library
, cardano-crypto-wrapper
, cardano-db
, cardano-sync
, cardano-ledger-alonzo
, cardano-ledger-byron
, cardano-ledger-core
, cardano-ledger-shelley-ma
, cardano-prelude
, cardano-slotting
Expand Down
@@ -1,7 +1,6 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}

module Cardano.DbSync.Era.Shelley.Generic.ParamProposal
Expand All @@ -14,6 +13,7 @@ import Cardano.Prelude
import Cardano.DbSync.Era.Shelley.Generic.Util (unKeyHashRaw)
import Cardano.DbSync.Era.Shelley.Generic.Witness (Witness (..))

import Cardano.Ledger.Coin (Coin)
import Cardano.Ledger.Shelley (ShelleyEra)
import qualified Cardano.Ledger.ShelleyMA as ShelleyMA

Expand All @@ -23,7 +23,6 @@ import qualified Data.Map.Strict as Map

import Shelley.Spec.Ledger.BaseTypes (UnitInterval, strictMaybeToMaybe)
import qualified Shelley.Spec.Ledger.BaseTypes as Shelley
import Shelley.Spec.Ledger.Coin (Coin)
import qualified Shelley.Spec.Ledger.Keys as Shelley
import qualified Shelley.Spec.Ledger.PParams as Shelley

Expand Down Expand Up @@ -55,7 +54,7 @@ convertParamProposal witness (Shelley.Update pp epoch) =
Shelley _ -> shelleyParamProposal epoch pp
Allegra _ -> allegraOrMaryParamProposal epoch pp
Mary _ -> allegraOrMaryParamProposal epoch pp
Alonzo _ -> panic "convertParamProposal: Alonzo"
-- Alonzo _ -> panic "convertParamProposal: Alonzo"

-- -------------------------------------------------------------------------------------------------

Expand Down
33 changes: 17 additions & 16 deletions cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Generic/Tx.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}

module Cardano.DbSync.Era.Shelley.Generic.Tx
Expand All @@ -24,14 +26,14 @@ import Cardano.DbSync.Era.Shelley.Generic.Metadata
import Cardano.DbSync.Era.Shelley.Generic.ParamProposal
import Cardano.DbSync.Era.Shelley.Generic.Witness

import Cardano.Ledger.Coin (Coin (..))
import Cardano.Ledger.Mary.Value (AssetName, PolicyID, Value (..))
import qualified Cardano.Ledger.SafeHash as Ledger
import qualified Cardano.Ledger.ShelleyMA.AuxiliaryData as ShelleyMa
import qualified Cardano.Ledger.ShelleyMA.TxBody as ShelleyMa

import Cardano.Slotting.Slot (SlotNo (..))

import qualified Data.ByteString.Lazy.Char8 as LBS
import Data.Coerce (coerce)
import qualified Data.Map.Strict as Map
import Data.MemoBytes (MemoBytes (..))
Expand All @@ -43,7 +45,6 @@ import Ouroboros.Consensus.Shelley.Ledger.Block (ShelleyBasedEra)

import qualified Shelley.Spec.Ledger.Address as Shelley
import qualified Shelley.Spec.Ledger.BaseTypes as Shelley
import Shelley.Spec.Ledger.Coin (Coin (..))
import Shelley.Spec.Ledger.Scripts ()
import qualified Shelley.Spec.Ledger.Tx as Shelley
import qualified Shelley.Spec.Ledger.TxBody as Shelley
Expand Down Expand Up @@ -93,7 +94,7 @@ fromAllegraTx (blkIndex, tx) =
Tx
{ txHash = txHashId tx
, txBlockIndex = blkIndex
, txSize = fromIntegral $ LBS.length (Shelley.txFullBytes tx)
, txSize = fromIntegral $ getField @"txsize" tx
, txInputs = map fromTxIn (toList . ShelleyMa.inputs $ unTxBodyRaw tx)
, txOutputs = zipWith fromTxOut [0 .. ] $ toList (ShelleyMa.outputs $ unTxBodyRaw tx)
, txFees = ShelleyMa.txfee (unTxBodyRaw tx)
Expand Down Expand Up @@ -132,19 +133,19 @@ fromShelleyTx (blkIndex, tx) =
Tx
{ txHash = txHashId tx
, txBlockIndex = blkIndex
, txSize = fromIntegral $ LBS.length (Shelley.txFullBytes tx)
, txInputs = map fromTxIn (toList . Shelley._inputs $ Shelley._body tx)
, txOutputs = zipWith fromTxOut [0 .. ] $ toList (Shelley._outputs $ Shelley._body tx)
, txFees = Shelley._txfee (Shelley._body tx)
, txOutSum = Coin . sum $ map txOutValue (Shelley._outputs $ Shelley._body tx)
, txSize = fromIntegral $ getField @"txsize" tx
, txInputs = map fromTxIn (toList . Shelley._inputs $ Shelley.body tx)
, txOutputs = zipWith fromTxOut [0 .. ] $ toList (Shelley._outputs $ Shelley.body tx)
, txFees = Shelley._txfee (Shelley.body tx)
, txOutSum = Coin . sum $ map txOutValue (Shelley._outputs $ Shelley.body tx)
, txInvalidBefore = Nothing
, txInvalidHereafter = Just $ Shelley._ttl (Shelley._body tx)
, txInvalidHereafter = Just $ Shelley._ttl (Shelley.body tx)
, txWithdrawalSum = Coin . sum . map unCoin . Map.elems
. Shelley.unWdrl $ Shelley._wdrls (Shelley._body tx)
, txMetadata = fromShelleyMetadata <$> Shelley.strictMaybeToMaybe (Shelley._metadata tx)
, txCertificates = zipWith TxCertificate [0..] (toList . Shelley._certs $ Shelley._body tx)
, txWithdrawals = map mkTxWithdrawal (Map.toList . Shelley.unWdrl . Shelley._wdrls $ Shelley._body tx)
, txParamProposal = maybe [] (convertParamProposal (Shelley Standard)) $ Shelley.strictMaybeToMaybe (Shelley._txUpdate $ Shelley._body tx)
. Shelley.unWdrl $ Shelley._wdrls (Shelley.body tx)
, txMetadata = fromShelleyMetadata <$> Shelley.strictMaybeToMaybe (getField @"auxiliaryData" tx)
, txCertificates = zipWith TxCertificate [0..] (toList . Shelley._certs $ Shelley.body tx)
, txWithdrawals = map mkTxWithdrawal (Map.toList . Shelley.unWdrl . Shelley._wdrls $ Shelley.body tx)
, txParamProposal = maybe [] (convertParamProposal (Shelley Standard)) $ Shelley.strictMaybeToMaybe (Shelley._txUpdate $ Shelley.body tx)
, txMint = mempty -- Shelley does not support Multi-Assets
}
where
Expand All @@ -165,7 +166,7 @@ fromMaryTx (blkIndex, tx) =
Tx
{ txHash = txHashId tx
, txBlockIndex = blkIndex
, txSize = fromIntegral $ LBS.length (Shelley.txFullBytes tx)
, txSize = fromIntegral $ getField @"txsize" tx
, txInputs = map fromTxIn (toList . ShelleyMa.inputs $ unTxBodyRaw tx)
, txOutputs = zipWith fromTxOut [0 .. ] $ toList (ShelleyMa.outputs $ unTxBodyRaw tx)
, txFees = ShelleyMa.txfee (unTxBodyRaw tx)
Expand Down Expand Up @@ -267,4 +268,4 @@ mkTxWithdrawal (ra, c) =
}

txHashId :: ShelleyBasedEra era => Shelley.Tx era -> ByteString
txHashId = Crypto.hashToBytes . Ledger.extractHash . Ledger.hashAnnotated . Shelley._body
txHashId = Crypto.hashToBytes . Ledger.extractHash . Ledger.hashAnnotated . Shelley.body
Expand Up @@ -36,6 +36,7 @@ import qualified Cardano.Crypto.Hash as Crypto
import Cardano.Db (DbLovelace (..))
import qualified Cardano.Db as Db

import Cardano.Ledger.Coin (Coin (..), DeltaCoin)
import qualified Cardano.Ledger.SafeHash as Ledger

import qualified Data.Binary.Put as Binary
Expand All @@ -50,7 +51,6 @@ import Ouroboros.Consensus.Cardano.Block (StandardAllegra, StandardCry

import qualified Shelley.Spec.Ledger.Address as Shelley
import qualified Shelley.Spec.Ledger.BaseTypes as Shelley
import Shelley.Spec.Ledger.Coin (Coin (..), DeltaCoin)
import qualified Shelley.Spec.Ledger.Credential as Shelley
import qualified Shelley.Spec.Ledger.Keys as Shelley
import qualified Shelley.Spec.Ledger.Scripts as Shelley
Expand Down
Expand Up @@ -7,7 +7,6 @@ module Cardano.DbSync.Era.Shelley.Generic.Witness


import Cardano.Ledger.Allegra (AllegraEra)
import Cardano.Ledger.Alonzo (AlonzoEra)
import Cardano.Ledger.Mary (MaryEra)
import Cardano.Ledger.Shelley (ShelleyEra)

Expand All @@ -32,10 +31,10 @@ data Witness era where
Shelley :: Evidence c -> Witness (ShelleyEra c)
Allegra :: Evidence c -> Witness (AllegraEra c)
Mary :: Evidence c -> Witness (MaryEra c)
Alonzo :: Evidence c -> Witness (AlonzoEra c)
-- Alonzo :: Evidence c -> Witness (AlonzoEra c)

instance Show (Witness e) where
show (Shelley c) = "Shelley " ++ show c
show (Allegra c) = "Allegra " ++ show c
show (Mary c) = "Mary " ++ show c
show (Alonzo c) = "Alonzo " ++ show c
-- show (Alonzo c) = "Alonzo " ++ show c
2 changes: 1 addition & 1 deletion cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Genesis.hs
Expand Up @@ -27,6 +27,7 @@ import Cardano.DbSync.Era.Util (liftLookupFail)
import Cardano.Sync.Error
import Cardano.Sync.Util

import qualified Cardano.Ledger.Coin as Shelley
import Cardano.Ledger.Era (Crypto)

import qualified Data.ByteString.Char8 as BS
Expand All @@ -41,7 +42,6 @@ import Ouroboros.Consensus.Cardano.Block (StandardCrypto, StandardShel
import Ouroboros.Consensus.Shelley.Node (ShelleyGenesis (..))

import qualified Shelley.Spec.Ledger.Address as Shelley
import qualified Shelley.Spec.Ledger.Coin as Shelley
import qualified Shelley.Spec.Ledger.Genesis as Shelley
import Shelley.Spec.Ledger.Scripts ()
import qualified Shelley.Spec.Ledger.TxBody as Shelley
Expand Down
5 changes: 3 additions & 2 deletions cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Insert.hs
Expand Up @@ -36,6 +36,9 @@ import Cardano.DbSync.Era.Shelley.Insert.Epoch
import Cardano.DbSync.Era.Shelley.Query
import Cardano.DbSync.Era.Util (liftLookupFail)

import Cardano.Ledger.Coin (Coin (..))
import qualified Cardano.Ledger.Coin as Shelley

import Cardano.Sync.Error
import Cardano.Sync.LedgerState
import Cardano.Sync.Types
Expand Down Expand Up @@ -64,8 +67,6 @@ import Ouroboros.Consensus.Cardano.Block (StandardCrypto)
import qualified Shelley.Spec.Ledger.Address as Shelley
import Shelley.Spec.Ledger.BaseTypes (strictMaybeToMaybe)
import qualified Shelley.Spec.Ledger.BaseTypes as Shelley
import Shelley.Spec.Ledger.Coin (Coin (..))
import qualified Shelley.Spec.Ledger.Coin as Shelley
import qualified Shelley.Spec.Ledger.Credential as Shelley
import qualified Shelley.Spec.Ledger.Keys as Shelley
import qualified Shelley.Spec.Ledger.PParams as Shelley
Expand Down
Expand Up @@ -21,6 +21,8 @@ import qualified Cardano.Db as DB
import qualified Cardano.DbSync.Era.Shelley.Generic as Generic
import Cardano.DbSync.Era.Shelley.Query

import qualified Cardano.Ledger.Coin as Shelley

import qualified Cardano.Sync.Era.Shelley.Generic as Generic
import Cardano.Sync.Error
import Cardano.Sync.LedgerState
Expand All @@ -41,7 +43,6 @@ import Database.Persist.Sql (SqlBackend, putMany)

import Ouroboros.Consensus.Cardano.Block (StandardCrypto)

import qualified Shelley.Spec.Ledger.Coin as Shelley
import qualified Shelley.Spec.Ledger.Rewards as Shelley

{- HLINT ignore "Use readTVarIO" -}
Expand Down
1 change: 1 addition & 0 deletions cardano-db-tool/cardano-db-tool.cabal
Expand Up @@ -51,6 +51,7 @@ library
, cardano-db
, cardano-sync
, cardano-ledger-byron
, cardano-ledger-core
, cardano-prelude
, cardano-slotting
, containers
Expand Down
1 change: 1 addition & 0 deletions cardano-db/cardano-db.cabal
Expand Up @@ -52,6 +52,7 @@ library
, base >= 4.14 && < 4.16
, base16-bytestring
, bytestring
, cardano-ledger-core
, cardano-slotting
, containers
, conduit
Expand Down
3 changes: 2 additions & 1 deletion cardano-db/src/Cardano/Db/Types.hs
Expand Up @@ -22,6 +22,8 @@ module Cardano.Db.Types
, word64ToAda
) where

import Cardano.Ledger.Coin (DeltaCoin (..))

import Data.Aeson.Encoding (unsafeToEncoding)
import Data.Aeson.Types (FromJSON (..), ToJSON (..))
import qualified Data.Aeson.Types as Aeson
Expand All @@ -36,7 +38,6 @@ import GHC.Generics (Generic)

import Quiet (Quiet (..))

import Shelley.Spec.Ledger.Coin (DeltaCoin (..))
import qualified Shelley.Spec.Ledger.Rewards as Shelley


Expand Down
1 change: 1 addition & 0 deletions cardano-sync/cardano-sync.cabal
Expand Up @@ -75,6 +75,7 @@ library
, cardano-crypto-wrapper
, cardano-db
, cardano-ledger-byron
, cardano-ledger-core
-- Only for some orphan tracing instances.
, cardano-node
, cardano-prelude
Expand Down
13 changes: 5 additions & 8 deletions cardano-sync/src/Cardano/Sync/Config/Cardano.hs
Expand Up @@ -25,8 +25,9 @@ import Cardano.Sync.Error

import Control.Monad.Trans.Except (ExceptT)

import Ouroboros.Consensus.Cardano (Nonce (..), Protocol (..))
import Ouroboros.Consensus.Cardano (Nonce (..))
import qualified Ouroboros.Consensus.Cardano as Consensus
import qualified Ouroboros.Consensus.Cardano.Node as Consensus
import Ouroboros.Consensus.Config (TopLevelConfig (..))
import Ouroboros.Consensus.Ledger.Basics (LedgerConfig)
import Ouroboros.Consensus.Node.ProtocolInfo (ProtocolInfo)
Expand Down Expand Up @@ -66,19 +67,15 @@ mkTopLevelConfig :: GenesisConfig -> TopLevelConfig CardanoBlock
mkTopLevelConfig = Consensus.pInfoConfig . mkProtocolInfoCardano

-- Need a concrete type for 'm' ('IO') to make the type checker happy.
mkProtocolInfoCardano :: GenesisConfig -> ProtocolInfo IO CardanoBlock
mkProtocolInfoCardano = Consensus.protocolInfo . mkProtocolCardano

-- | The vast majority of the following struct fields are *COMPLETELY IRRELEVANT* to the
-- operation of db-sync, but I have no idea at all what happens of any of these are
-- wrong. This really needs to be a done a different way.
-- mkProtocolCardano :: GenesisConfig -> Protocol m CardanoBlock CardanoProtocol

mkProtocolCardano :: GenesisConfig -> Protocol m CardanoBlock CardanoProtocol
mkProtocolCardano ge =
mkProtocolInfoCardano :: GenesisConfig -> ProtocolInfo IO CardanoBlock
mkProtocolInfoCardano ge =
case ge of
GenesisCardano dnc byronGenesis shelleyGenesis ->
Consensus.ProtocolCardano
Consensus.protocolInfoCardano
Consensus.ProtocolParamsByron
{ Consensus.byronGenesis = byronGenesis
, Consensus.byronPbftSignatureThreshold = Consensus.PBftSignatureThreshold <$> dncPBftSignatureThreshold dnc
Expand Down

0 comments on commit ee0b4a6

Please sign in to comment.