Skip to content

Commit

Permalink
Downgrade dependencies to match node
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Sep 24, 2021
1 parent e6ca79a commit b13615c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 31 deletions.
21 changes: 10 additions & 11 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-base
tag: 592aa61d657ad5935a33bace1243abce3728b643
--sha256: 1bgq3a2wfdz24jqfwylcc6jjg5aji8dpy5gjkhpnmkkvgcr2rkyb
tag: e8a48cf0500b03c744c7fc6f2fedb86e8bdbe055
--sha256: 0s3w796y4bgjidg5iwapdq88cq9ipy346gagbip6xlqxdvpp99xj
subdir:
base-deriving-via
binary
Expand All @@ -121,8 +121,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-ledger-specs
tag: ec51e4fb1b17461ab612cf427b79f1742942e8cb
--sha256: 05bwy7x1asyfshqsfsyv2c70qwrxp4680xlvhwdm1hz9bi0lpq41
tag: f827a4321e42f528e25f6079f7af3eb18f10d391
--sha256: 0dmgxg7cpgz4lnscqrrk4gakw9w90dx8ljv5wr923rfp9nyzc5qf
subdir:
alonzo/impl
byron/chain/executable-spec
Expand All @@ -132,7 +132,6 @@ source-repository-package
byron/ledger/impl
byron/ledger/impl/test
cardano-ledger-core
cardano-protocol-tpraos
semantics/executable-spec
semantics/small-steps-test
shelley/chain-and-ledger/dependencies/non-integer
Expand All @@ -144,8 +143,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node
tag: 191b91eec3c7d845a55347781329d50bf36871d7
--sha256: 1y0a80fmrqf7561yqp4p2vx36yrhh83222b01sall2rk791y4yf0
tag: 0fb43f4e3da8b225f4f86557aed90a183981a64f
--sha256: 0mkir1pg78hp7adxgb8cz6jj4izs07np23fxxnwhkvf0ql92nan7
subdir:
cardano-api
cardano-config
Expand Down Expand Up @@ -190,8 +189,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/ouroboros-network
tag: 5d37a927046bc7da2887830d8e35cf604622ce09
--sha256: 1620zcnivgm1wp1kq3vqc44g77lv7dalzgywc96qsblf1sv9fw3p
tag: aa7bc087737edca29133844b14bb7cba2cd213f2
--sha256: 1rcjlj5z8igrfy07lkdrlm4xcx9a3g0jl69wvqk0vvff4hfr00ar
subdir:
cardano-client
io-sim
Expand All @@ -211,8 +210,8 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/plutus
tag: 15121dd4dc66df7c17c6c0f2f4a8702ad841c020
--sha256: 1g5jm1r58x5ly3vsk8hr3dviqnv1bqhxi2b87vmr53554pd6zcqp
tag: edc6d4672c41de4485444122ff843bc86ff421a0
--sha256: 1h3s4dymhcpkjkn7cc918h9gp166hv9arj15wgjjd6jg7l7zapf0
subdir:
plutus-core
plutus-ledger-api
Expand Down
1 change: 0 additions & 1 deletion cardano-db-sync/cardano-db-sync.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ library
, cardano-ledger-core
, cardano-ledger-shelley-ma
, cardano-prelude
, cardano-protocol-tpraos
, cardano-slotting
, containers
, esqueleto
Expand Down
32 changes: 15 additions & 17 deletions cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Generic/Block.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ import Cardano.Ledger.SafeHash (SafeToHash)

import Cardano.Prelude

import qualified Cardano.Protocol.TPraos.BHeader as Protocol
import qualified Cardano.Protocol.TPraos.OCert as Protocol

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

import Ouroboros.Consensus.Cardano.Block (StandardAllegra, StandardAlonzo, StandardCrypto,
Expand All @@ -48,6 +45,7 @@ import qualified Ouroboros.Consensus.Shelley.Ledger.Block as Consensus
import Ouroboros.Network.Block (BlockNo (..))

import qualified Shelley.Spec.Ledger.BlockChain 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 @@ -152,31 +150,31 @@ fromAlonzoBlock pp blk =
alonzoBlockTxs :: ShelleyBlock StandardAlonzo -> [(Word64, Ledger.Tx StandardAlonzo)]
alonzoBlockTxs = zip [0 ..] . toList . fromTxSeq @StandardAlonzo . Shelley.bbody . Consensus.shelleyBlockRaw

blockBody :: ShelleyBasedEra era => ShelleyBlock era -> Protocol.BHBody (Crypto era)
blockBody = Protocol.bhbody . Shelley.bheader . Consensus.shelleyBlockRaw
blockBody :: ShelleyBasedEra era => ShelleyBlock era -> Shelley.BHBody (Crypto era)
blockBody = Shelley.bhbody . Shelley.bheader . Consensus.shelleyBlockRaw

blockHash :: ShelleyBlock era -> ByteString
blockHash =
Crypto.hashToBytes . Protocol.unHashHeader
Crypto.hashToBytes . Shelley.unHashHeader
. Consensus.unShelleyHash . Consensus.shelleyBlockHeaderHash

blockNumber :: ShelleyBasedEra era => ShelleyBlock era -> BlockNo
blockNumber = Protocol.bheaderBlockNo . blockBody
blockNumber = Shelley.bheaderBlockNo . blockBody

blockPrevHash :: ShelleyBasedEra era => ShelleyBlock era -> ByteString
blockPrevHash blk =
case Protocol.bheaderPrev (Protocol.bhbody . Shelley.bheader $ Consensus.shelleyBlockRaw blk) of
Protocol.GenesisHash -> "Cardano.DbSync.Era.Shelley.Generic.Block.blockPrevHash"
Protocol.BlockHash (Protocol.HashHeader h) -> Crypto.hashToBytes h
case Shelley.bheaderPrev (Shelley.bhbody . Shelley.bheader $ Consensus.shelleyBlockRaw blk) of
Shelley.GenesisHash -> "Cardano.DbSync.Era.Shelley.Generic.Block.blockPrevHash"
Shelley.BlockHash (Shelley.HashHeader h) -> Crypto.hashToBytes h

blockOpCert :: ShelleyBasedEra era => ShelleyBlock era -> ByteString
blockOpCert = KES.rawSerialiseVerKeyKES . Protocol.ocertVkHot . Protocol.bheaderOCert . blockBody
blockOpCert = KES.rawSerialiseVerKeyKES . Shelley.ocertVkHot . Shelley.bheaderOCert . blockBody

blockOpCertCounter :: ShelleyBasedEra era => ShelleyBlock era -> Word64
blockOpCertCounter = Protocol.ocertN . Protocol.bheaderOCert . blockBody
blockOpCertCounter = Shelley.ocertN . Shelley.bheaderOCert . blockBody

blockProtoVersion :: ShelleyBasedEra era => ShelleyBlock era -> Shelley.ProtVer
blockProtoVersion = Protocol.bprotver . blockBody
blockProtoVersion = Shelley.bprotver . blockBody

blockSize :: ShelleyBasedEra era => ShelleyBlock era -> Word64
blockSize = fromIntegral . Shelley.bBodySize . Shelley.bbody . Consensus.shelleyBlockRaw
Expand All @@ -190,16 +188,16 @@ blockTxs
blockTxs = zip [0 ..] . unTxSeq . Shelley.bbody . Consensus.shelleyBlockRaw

blockVrfKeyView :: (ShelleyBasedEra era, VRF (Crypto era) ~ PraosVRF) => ShelleyBlock era -> Text
blockVrfKeyView = Api.serialiseToBech32 . Api.VrfVerificationKey . Protocol.bheaderVrfVk . blockBody
blockVrfKeyView = Api.serialiseToBech32 . Api.VrfVerificationKey . Shelley.bheaderVrfVk . blockBody

creatorPoolHash :: ShelleyBasedEra era => ShelleyBlock era -> ByteString
creatorPoolHash = unKeyHashRaw . Protocol.issuerIDfromBHBody . blockBody
creatorPoolHash = unKeyHashRaw . Shelley.issuerIDfromBHBody . blockBody

slotLeaderHash :: ShelleyBasedEra era => ShelleyBlock era -> ByteString
slotLeaderHash = unKeyHashRaw . Protocol.issuerIDfromBHBody . blockBody
slotLeaderHash = unKeyHashRaw . Shelley.issuerIDfromBHBody . blockBody

slotNumber :: (Crypto era ~ StandardCrypto, ShelleyBasedEra era) => ShelleyBlock era -> SlotNo
slotNumber = Protocol.bheaderSlotNo . blockBody
slotNumber = Shelley.bheaderSlotNo . blockBody

unTxSeq
:: (ShelleyBasedEra era, SafeToHash (Witnesses era))
Expand Down
3 changes: 1 addition & 2 deletions cardano-db-tool/src/Cardano/Db/Tool/Validate/Balance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ getAlonzoBalance addrText utxo = do
compactTxOutValue :: CompactAddr (Crypto era) -> Ledger.TxOut era -> Maybe Coin
compactTxOutValue caddr txOut =
let (scaddr, val) = case txOut of
Alonzo.TxOutCompact a v -> (a, v)
Alonzo.TxOutCompactDH a v _ -> (a, v)
Alonzo.TxOutCompact a v _ -> (a, v)
in if caddr == scaddr
then Just $ coin (fromCompact val)
else Nothing
Expand Down

0 comments on commit b13615c

Please sign in to comment.