Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Use the same dependencies as 1.24.0 of the node.
  • Loading branch information
erikd committed Dec 2, 2020
1 parent d73c352 commit 73bdd2e
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 56 deletions.
24 changes: 12 additions & 12 deletions cabal.project
@@ -1,4 +1,4 @@
index-state: 2020-10-01T00:00:00Z
index-state: 2020-11-15T00:00:00Z

packages:
cardano-db
Expand Down Expand Up @@ -52,8 +52,8 @@ package ouroboros-consensus-cardano
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-base
tag: 6226a0feb1d74f50a430242a1b4608fd48e10aad
--sha256: 034q2anpbc7bgp5draykz6lkzznxk31wy4nbgr4jv4f7778yls6b
tag: 2574600da11065937c1f07e4b234ecb451016a2e
--sha256: 0nq8bpzsr3fd2i59a6s6qb6slpymjh47zv57wlifjfvhh0xlgmpx
subdir:
binary
binary/test
Expand All @@ -70,7 +70,7 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger-specs
tag: 7c64ed8ca2e2141780326ac2990f59ab942356af
tag: 345683717da0e5008103a9e25cc2445736ca8e82
--sha256: 0md1lm50jyg0navmw9yazzsvw4xrbzvsvawlk91rmpsxfscn92yz
subdir:
byron/crypto
Expand All @@ -89,8 +89,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node
tag: 4aa93f48328abb49ba5e35c65a17f64601eaa298
--sha256: 17gkx986zini3w4y6gcw63a8xwikl261bm9wh67n55kg6yh3lmpx
tag: 3bfead449bae8a4b19635196334c7e81b3752e20
--sha256: 13ngy5cbx870n6rknmiiw2d7xafynbn2rzzcj2qg0lr25qwzh345
subdir:
cardano-api
cardano-config
Expand All @@ -100,8 +100,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-prelude
tag: 58e146c14e1349553d0ed75dd5245bbe65f0533e
--sha256: 166rm0sxldnf0g2g9jp4k0rgd01wcbm0g54fcw3bxilzr1dvwqfi
tag: 742e8525b96bf4b66fb61a00c8298d75d7931d5e
--sha256: 1132r58bjgdcf7yz3n77nlrkanqcmpn5b5km4nw151yar2dgifsv
subdir:
cardano-prelude
cardano-prelude-test
Expand All @@ -115,8 +115,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/iohk-monitoring-framework
tag: b5965e013fbcfb2a155582953d4a9a99eee22a8a
--sha256: 0c2xmf57rw2p1llm69x4b3cxzigxj0iyxa6cl0ivps92m9l2rv2n
tag: 563e79f28c6da5c547463391d4c58a81442e48db
--sha256: 1is18h9kk8j16my89q76nihvapiiff3jl8777vk7c4wl2h4zry2w
subdir:
contra-tracer
iohk-monitoring
Expand All @@ -130,8 +130,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-network
tag: 57ab00435e6c38d146e029ac2d3f824ff6e738a8
--sha256: 0l9nv0lr9wxf9z7gs91dvpci7ghfbk9d4mcly1mm5xd76d21jbbb
tag: 7e00984293b51fed8e72683607d8b9e0717382bd
--sha256: 1m89ih9m4p48nw1mybzf3ssr5va9ppsskx9pl9130aczhhi5ix85
subdir:
cardano-client
io-sim
Expand Down
6 changes: 3 additions & 3 deletions cardano-db-sync/src/Cardano/DbSync/Era/Allegra/Insert.hs
Expand Up @@ -43,6 +43,7 @@ import Cardano.DbSync.LedgerState
import Cardano.DbSync.Types
import Cardano.DbSync.Util

import qualified Cardano.Ledger.Core as ShelleyMa
import Cardano.Ledger.Era (Crypto)

import Cardano.Slotting.Slot (EpochNo (..), EpochSize (..))
Expand All @@ -65,7 +66,6 @@ import qualified Shelley.Spec.Ledger.BaseTypes as Shelley
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.MetaData as Shelley
import qualified Shelley.Spec.Ledger.PParams as Shelley
import qualified Shelley.Spec.Ledger.Tx as Shelley
import qualified Shelley.Spec.Ledger.TxBody as Shelley
Expand Down Expand Up @@ -555,10 +555,10 @@ insertParamProposal _tracer txId (Shelley.Update (Shelley.ProposedPPUpdates umap

insertTxMetadata
:: (MonadBaseControl IO m, MonadIO m)
=> Trace IO Text -> DB.TxId -> Shelley.MetaData
=> Trace IO Text -> DB.TxId -> ShelleyMa.Metadata StandardAllegra
-> ExceptT DbSyncNodeError (ReaderT SqlBackend m) ()
insertTxMetadata tracer txId metadata =
mapM_ insert $ Map.toList (fromAllegraMetaData metadata)
mapM_ insert $ Map.toList (fromAllegraMetadata metadata)
where
insert
:: (MonadBaseControl IO m, MonadIO m)
Expand Down
25 changes: 15 additions & 10 deletions cardano-db-sync/src/Cardano/DbSync/Era/Allegra/Metadata.hs
Expand Up @@ -8,14 +8,17 @@
{-# LANGUAGE TypeFamilies #-}

module Cardano.DbSync.Era.Allegra.Metadata
( fromAllegraMetaData
( fromAllegraMetadata
, metadataValueToJsonNoSchema
) where

import Cardano.Prelude

import Cardano.Api.Shelley (TxMetadataValue (..))

-- import qualified Cardano.Ledger.Core as ShelleyMa
import qualified Cardano.Ledger.ShelleyMA.Metadata as ShelleyMa

import qualified Data.Aeson as Aeson
import qualified Data.Aeson.Text as Aeson.Text
import qualified Data.ByteString.Base16 as Base16
Expand All @@ -26,25 +29,27 @@ import qualified Data.Text.Lazy as Text.Lazy
import Data.Tuple.Extra (both)
import qualified Data.Vector as Vector

import qualified Shelley.Spec.Ledger.MetaData as Allegra
import Ouroboros.Consensus.Cardano.Block (StandardAllegra)

import qualified Shelley.Spec.Ledger.MetaData as Shelley

-- This module should not even exist. The only reason it does is because functionality
-- that was in cardano-node commit 0dc6efa467a0fdae7aba7c5bcd5c657e189c8f19 and being
-- used here in db-sync was drastically changed and then the changed version was not
-- exported.

fromAllegraMetaData :: Allegra.MetaData -> Map Word64 TxMetadataValue
fromAllegraMetaData (Allegra.MetaData mdMap) =
fromAllegraMetadata :: ShelleyMa.Metadata StandardAllegra -> Map Word64 TxMetadataValue
fromAllegraMetadata (ShelleyMa.Metadata mdMap _scripts) =
Map.map fromAllegraMetaDatum mdMap
where
fromAllegraMetaDatum :: Allegra.MetaDatum -> TxMetadataValue
fromAllegraMetaDatum :: Shelley.MetaDatum -> TxMetadataValue
fromAllegraMetaDatum smd =
case smd of
Allegra.I x -> TxMetaNumber x
Allegra.B x -> TxMetaBytes x
Allegra.S x -> TxMetaText x
Allegra.List xs -> TxMetaList $ map fromAllegraMetaDatum xs
Allegra.Map xs -> TxMetaMap $ map (both fromAllegraMetaDatum) xs
Shelley.I x -> TxMetaNumber x
Shelley.B x -> TxMetaBytes x
Shelley.S x -> TxMetaText x
Shelley.List xs -> TxMetaList $ map fromAllegraMetaDatum xs
Shelley.Map xs -> TxMetaMap $ map (both fromAllegraMetaDatum) xs


metadataValueToJsonNoSchema :: TxMetadataValue -> Aeson.Value
Expand Down
6 changes: 3 additions & 3 deletions cardano-db-sync/src/Cardano/DbSync/Era/Allegra/Util.hs
Expand Up @@ -62,6 +62,7 @@ import qualified Cardano.Db as Db
import Cardano.DbSync.Config
import Cardano.DbSync.Era.Allegra.Types

import qualified Cardano.Ledger.Core as ShelleyMa
import Cardano.Ledger.Era (Crypto)
import qualified Cardano.Ledger.ShelleyMA.Timelocks as ShelleyMa
import qualified Cardano.Ledger.ShelleyMA.TxBody as ShelleyMa
Expand All @@ -88,7 +89,6 @@ import qualified Shelley.Spec.Ledger.BlockChain as Shelley
import Shelley.Spec.Ledger.Coin (Coin (..))
import qualified Shelley.Spec.Ledger.Hashing as Shelley
import qualified Shelley.Spec.Ledger.Keys as Shelley
import qualified Shelley.Spec.Ledger.MetaData as Shelley
import qualified Shelley.Spec.Ledger.OCert as Shelley
import qualified Shelley.Spec.Ledger.PParams as Shelley
import qualified Shelley.Spec.Ledger.Tx as Shelley
Expand Down Expand Up @@ -215,8 +215,8 @@ txInvalidHereAfter :: Shelley.Tx StandardAllegra -> Maybe Word64
txInvalidHereAfter =
fmap unSlotNo . Shelley.strictMaybeToMaybe . ShelleyMa.validFrom . ShelleyMa.vldt . unTxBodyRaw

txMetadata :: Shelley.Tx StandardAllegra -> Maybe Shelley.MetaData
txMetadata = Shelley.strictMaybeToMaybe . Shelley._metadata
txMetadata :: Shelley.Tx StandardAllegra -> Maybe (ShelleyMa.Metadata StandardAllegra)
txMetadata (Shelley.Tx _body _wit md) = Shelley.strictMaybeToMaybe md

-- Regardless of the type name, this is actually a parameter update *proposal*
-- rather than the update itself.
Expand Down
14 changes: 5 additions & 9 deletions cardano-db/src/Cardano/Db/Run.hs
Expand Up @@ -34,7 +34,8 @@ import Database.Persist.Sql (IsolationLevel (..), SqlBackend, runSqlCo
import Database.PostgreSQL.Simple (connectPostgreSQL)

import Database.Esqueleto
import Database.Esqueleto.Internal.Sql
import Database.Esqueleto.Internal.Internal (Mode (SELECT), SqlSelect, initialIdentState,
toRawSql)

import Cardano.Db.PGConfig

Expand Down Expand Up @@ -134,19 +135,15 @@ defaultOutput :: Handle
-> LogStr
-> IO ()
defaultOutput h loc src level msg =
BS.hPutStr h ls
where
ls = defaultLogStrBS loc src level msg
BS.hPutStr h $ defaultLogStrBS loc src level msg

defaultLogStrBS :: Loc
-> LogSource
-> LogLevel
-> LogStr
-> BS.ByteString
defaultLogStrBS a b c d =
toBS $ defaultLogStr a b c d
where
toBS = fromLogStr
fromLogStr $ defaultLogStr a b c d

getBackendGhci :: IO SqlBackend
getBackendGhci = do
Expand All @@ -158,8 +155,7 @@ ghciDebugQuery :: SqlSelect a r => SqlQuery a -> IO ()
ghciDebugQuery query = do
pgconfig <- readPGPassFileEnv
runStdoutLoggingT . withPostgresqlConn (toConnectionString pgconfig) $ \backend -> do
let
(sql,params) = toRawSql SELECT (backend, initialIdentState) query
let (sql,params) = toRawSql SELECT (backend, initialIdentState) query
liftIO $ do
LT.putStr $ LT.toLazyText sql
print params
1 change: 1 addition & 0 deletions cardano-db/src/Cardano/Db/Schema.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
Expand Down
48 changes: 29 additions & 19 deletions stack.yaml
@@ -1,4 +1,4 @@
resolver: https://raw.githubusercontent.com/input-output-hk/cardano-prelude/58e146c14e1349553d0ed75dd5245bbe65f0533e/snapshot.yaml
resolver: https://raw.githubusercontent.com/input-output-hk/cardano-prelude/742e8525b96bf4b66fb61a00c8298d75d7931d5e/snapshot.yaml
compiler: ghc-8.6.5

allow-newer: true
Expand Down Expand Up @@ -30,15 +30,15 @@ extra-deps:
- containers-0.5.11.0
- data-clist-0.1.2.3
- ekg-prometheus-adapter-0.1.0.4
- esqueleto-3.2.2
- esqueleto-3.4.0.1
- generic-monoid-0.1.0.0
- libsystemd-journal-1.4.4
- network-3.1.1.1
- snap-core-1.0.4.1
- snap-server-1.1.1.1
- persistent-2.10.5.1
- persistent-postgresql-2.10.1.2
- persistent-template-2.8.2.3
- persistent-2.11.0.1
- persistent-postgresql-2.11.0.0
- persistent-template-2.9.1.0
- prometheus-2.1.2
- pvss-0.2.0
- tasty-hedgehog-1.0.0.2
Expand All @@ -60,12 +60,19 @@ extra-deps:
- http-api-data-0.4.1.1
- time-compat-1.9.2.2
- quiet-0.2
- partial-order-0.2.0.0
- text-1.2.4.0
- base64-0.4.2.2
- bech32-1.1.0
- ghc-byteorder-4.11.0.0.10
- systemd-2.3.0
- memory-0.15.0

- git: https://github.com/input-output-hk/cardano-crypto
commit: 2547ad1e80aeabca2899951601079408becbc92c

- git: https://github.com/input-output-hk/cardano-prelude
commit: 58e146c14e1349553d0ed75dd5245bbe65f0533e
commit: 742e8525b96bf4b66fb61a00c8298d75d7931d5e
subdirs:
- cardano-prelude
- cardano-prelude-test
Expand All @@ -83,7 +90,7 @@ extra-deps:
- tracer-transformers

- git: https://github.com/input-output-hk/cardano-base
commit: 6226a0feb1d74f50a430242a1b4608fd48e10aad
commit: 980e6ca052c8dbad91336b6230c58b78ac1032f5
subdirs:
- binary
- cardano-crypto-praos
Expand All @@ -104,35 +111,38 @@ extra-deps:
- byron/ledger/impl
- byron/ledger/impl/test
- semantics/executable-spec
- semantics/small-steps-test
- shelley/chain-and-ledger/dependencies/non-integer
- shelley/chain-and-ledger/executable-spec
- shelley/chain-and-ledger/executable-spec/test
- shelley/chain-and-ledger/shelley-spec-ledger-test
- shelley-ma/impl

- git: https://github.com/input-output-hk/ouroboros-network
commit: 57ab00435e6c38d146e029ac2d3f824ff6e738a8
commit: 680b1725cdc10d6ae09b311509ef7c59c93372fd
subdirs:
- cardano-client
- io-sim
- io-sim-classes
- network-mux
- ouroboros-network
- ouroboros-network-framework
- Win32-network
- ouroboros-consensus
- ouroboros-consensus-byron
- ouroboros-consensus-byronspec
- ouroboros-consensus-shelley
- ouroboros-consensus-cardano
- ouroboros-consensus-shelley
- ouroboros-network
- ouroboros-network-framework
- ouroboros-network-testing
- typed-protocols
- typed-protocols-examples
- ouroboros-network-testing
- ouroboros-consensus/ouroboros-consensus-mock
- ouroboros-consensus/ouroboros-consensus-test-infra
- network-mux
- Win32-network


- git: https://github.com/input-output-hk/cardano-node
commit: 58e7a0409fdedbcf630527325ce9532484f6a31f
commit: 247d59f1ad05974db5c3657afc15a86f454196e2
subdirs:
- cardano-api
- cardano-config
- cardano-node
- hedgehog-extras

flags:
# Bundle VRF crypto in libsodium and do not rely on an external fork to have it.
Expand Down

0 comments on commit 73bdd2e

Please sign in to comment.