Skip to content

Commit

Permalink
Update dependencies to cardano==8.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jan 24, 2024
1 parent 3f316ac commit abf409e
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 23 deletions.
11 changes: 7 additions & 4 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ package direct-sqlite

constraints:
, any.base == 4.18.1.0
, any.cardano-node == 8.6.0
, any.cardano-ledger-conway == 1.10.1.0
, direct-sqlite == 2.3.29
, any.cardano-node == 8.7.2
, any.cardano-ledger-conway == 1.11.0.0
, any.ouroboros-consensus == 0.14.0.0
, any.ouroboros-consensus-cardano == 0.12.1.0
, any.formatting == 7.2.0
, quickcheck-state-machine ^>= 0.7
, any.text source
, any.formatting >= 7.2
, direct-sqlite == 2.3.29

allow-newer:
*:formatting
Expand Down
1 change: 1 addition & 0 deletions kupo.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions modules/websockets-json/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ library:
ghc-options: *ghc-options-lib
dependencies:
- aeson
- attoparsec-aeson
- bytestring
- connection
- exceptions
Expand Down
1 change: 1 addition & 0 deletions modules/websockets-json/websockets-json.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ library:
- -O2
dependencies:
- aeson
- attoparsec-aeson
- base16
- base58-bytestring
- base64
Expand Down
2 changes: 1 addition & 1 deletion src/Kupo/Data/Cardano/BinaryData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Kupo.Data.Cardano.DatumHash
( DatumHash
)

import qualified Cardano.Ledger.Alonzo.Scripts.Data as Ledger
import qualified Cardano.Ledger.Plutus.Data as Ledger
import qualified Cardano.Ledger.SafeHash as Ledger
import qualified Data.Aeson as Json
import qualified Data.Aeson.Encoding as Json
Expand Down
2 changes: 1 addition & 1 deletion src/Kupo/Data/Cardano/Datum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Kupo.Data.Cardano.DatumHash
( DatumHash
)

import qualified Cardano.Ledger.Alonzo.Scripts.Data as Ledger
import qualified Cardano.Ledger.Plutus.Data as Ledger

data Datum
= NoDatum
Expand Down
2 changes: 1 addition & 1 deletion src/Kupo/Data/Cardano/Script.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Ouroboros.Consensus.Util
( eitherToMaybe
)

import qualified Cardano.Ledger.Language as Ledger
import qualified Cardano.Ledger.Plutus.Language as Ledger

import qualified Cardano.Ledger.Allegra.Scripts as Ledger.Allegra
import qualified Cardano.Ledger.Allegra.TxAuxData as Ledger.Allegra
Expand Down
9 changes: 5 additions & 4 deletions src/Kupo/Data/Cardano/Value.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Kupo.Data.Cardano.PolicyId
, unsafePolicyIdFromBytes
)

import qualified Cardano.Ledger.Coin as Ledger
import qualified Cardano.Ledger.Hashes as Ledger
import qualified Cardano.Ledger.Mary.Value as Ledger
import qualified Data.Aeson as Json
Expand Down Expand Up @@ -51,13 +52,13 @@ unsafeValueFromList
-> Value
unsafeValueFromList ada assets =
Ledger.valueFromList
ada
(Ledger.Coin ada)
[ ( unsafePolicyIdFromBytes pid, unsafeAssetNameFromBytes name, q)
| (pid, name, q) <- assets
]

valueToJson :: Value -> Json.Encoding
valueToJson (Ledger.MaryValue coins (Ledger.MultiAsset assets)) =
valueToJson (Ledger.MaryValue (Ledger.Coin coins) (Ledger.MultiAsset assets)) =
Json.pairs $
Json.pair "coins" (Json.integer coins)
<>
Expand Down Expand Up @@ -103,8 +104,8 @@ data ComparableValue = ComparableValue

fromComparableValue :: ComparableValue -> Value
fromComparableValue (ComparableValue ada assets) =
Ledger.MaryValue ada (Ledger.MultiAsset assets)
Ledger.MaryValue (Ledger.Coin ada) (Ledger.MultiAsset assets)

toComparableValue :: Value -> ComparableValue
toComparableValue (Ledger.MaryValue ada (Ledger.MultiAsset assets)) =
toComparableValue (Ledger.MaryValue (Ledger.Coin ada) (Ledger.MultiAsset assets)) =
ComparableValue ada assets
18 changes: 9 additions & 9 deletions src/Kupo/Data/Database.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ import Ouroboros.Consensus.Block
)

import qualified Cardano.Ledger.Address as Ledger
import qualified Cardano.Ledger.Alonzo.Scripts.Data as Ledger
import qualified Cardano.Ledger.BaseTypes as Ledger
import qualified Cardano.Ledger.Core as Ledger
import qualified Cardano.Ledger.Credential as Ledger
import qualified Cardano.Ledger.Keys as Ledger
import qualified Cardano.Ledger.Plutus.Data as Ledger
import qualified Cardano.Ledger.TxIn as Ledger
import qualified Data.Binary.Get as B
import qualified Data.Binary.Put as B
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BSL
import qualified Data.ByteString.Lazy as BL
import qualified Kupo.Data.Cardano as App
import qualified Kupo.Data.Pattern as App

Expand Down Expand Up @@ -232,24 +232,24 @@ policyToRow (outputReferenceToRow -> outputReference) (App.policyIdToBytes -> po
--
extendedOutputReferenceToRow :: App.ExtendedOutputReference -> ByteString
extendedOutputReferenceToRow (Ledger.TxIn txId (Ledger.TxIx outIx), txIx) =
BSL.toStrict $ B.runPut $ do
BL.toStrict $ B.runPut $ do
B.putByteString (transactionIdToBytes txId)
B.putWord16be (fromIntegral outIx)
B.putWord16be txIx

outputReferenceToRow :: App.OutputReference -> ByteString
outputReferenceToRow (Ledger.TxIn txId (Ledger.TxIx outIx)) =
BSL.toStrict $ B.runPut $ do
BL.toStrict $ B.runPut $ do
B.putByteString (transactionIdToBytes txId)
B.putWord16be (fromIntegral outIx)

extendedOutputReferenceFromRow :: ByteString -> App.ExtendedOutputReference
extendedOutputReferenceFromRow bytes =
case B.runGetOrFail parser (BSL.fromStrict bytes) of
case B.runGetOrFail parser (BL.fromStrict bytes) of
Left (_remaining, _offset, hint) ->
error (toText hint)
Right (remaining, _offset, result) ->
if BSL.null remaining
if BL.null remaining
then result
else error "outputReferenceFromRow: non-empty remaining bytes"
where
Expand Down Expand Up @@ -525,7 +525,7 @@ scriptReferenceFromRow hash = \case
addressToRow
:: App.Address
-> Text
addressToRow = encodeBase16 . BSL.toStrict . B.runPut . \case
addressToRow = encodeBase16 . BL.toStrict . B.runPut . \case
Ledger.AddrBootstrap (Ledger.BootstrapAddress addr) -> do
B.putWord8 0
B.putByteString (serializeCbor @ByronEra encCBOR addr)
Expand Down Expand Up @@ -563,11 +563,11 @@ addressFromRow =
unsafeDeserialize . unsafeDecodeBase16
where
unsafeDeserialize bytes =
case B.runGetOrFail getAddr (BSL.fromStrict bytes) of
case B.runGetOrFail getAddr (BL.fromStrict bytes) of
Left (_remaining, _offset, hint) ->
error (toText hint)
Right (remaining, _offset, result) ->
if BSL.null remaining
if BL.null remaining
then result
else error "addressFromRow: non-empty remaining bytes"

Expand Down
4 changes: 2 additions & 2 deletions test/Test/Kupo/App/MailboxSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import Test.QuickCheck

spec :: Spec
spec = parallel $ context "Mailbox" $ do
specify "producer / consumer simulations" $ do
specify @(IO ()) "producer / consumer simulations" $ do
let n = 10_000
msgs <- generate $ vectorOf n $ frequency
[ (1, Right <$> arbitrary)
Expand All @@ -73,7 +73,7 @@ spec = parallel $ context "Mailbox" $ do
(producer mailbox msgs)
pure msgs'
let analyze = \case
TraceMainReturn t msgs' _ -> do
TraceMainReturn t _ msgs' _ -> do
-- NOTE: The diving factor is 'arbitrary' but it just shows
-- that it is much faster to do this work concurrently than
-- it would be to process all messages one-by-one. We show
Expand Down
2 changes: 1 addition & 1 deletion test/vectors/ogmios
Submodule ogmios updated 2177 files

0 comments on commit abf409e

Please sign in to comment.