Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADP-3452] Bump cardano-node dependency to 9.2.0 #4790

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,4 @@ package.json
# buildkite artifacts testing
artifacts
deposit-*
cabal.project.freeze
10 changes: 4 additions & 6 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ repository cardano-haskell-packages
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

-- repeating the index-state for hackage to work around hackage.nix parsing limitation
index-state: 2024-08-08T00:00:00Z
index-state: 2024-09-23T00:00:00Z

index-state:
, hackage.haskell.org 2024-08-08T00:00:00Z
, cardano-haskell-packages 2024-09-01T03:50:08Z
, hackage.haskell.org 2024-09-23T00:00:00Z
, cardano-haskell-packages 2024-09-20T19:39:13Z

packages:
lib/address-derivation-discovery
Expand Down Expand Up @@ -187,9 +187,7 @@ constraints:
, io-classes >= 1.4
, io-classes -asserts

, ouroboros-consensus-cardano ^>= 0.18
, ouroboros-network ^>= 0.16.1
, ouroboros-network-protocols ^>= 0.9
, ouroboros-network ^>= 0.17
paolino marked this conversation as resolved.
Show resolved Hide resolved


-- Related to: https://github.com/haskell/cabal/issues/8554
Expand Down
126 changes: 38 additions & 88 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
flake = false;
};
customConfig.url = "github:input-output-hk/empty-flake";
cardano-node-runtime.url = "github:IntersectMBO/cardano-node?ref=9.1.1";
cardano-node-runtime.url = "github:IntersectMBO/cardano-node?ref=9.2.0";
};

outputs = { self, nixpkgs, nixpkgs-unstable, hostNixpkgs, flake-utils,
Expand Down
16 changes: 9 additions & 7 deletions lib/cardano-api-extra/lib/Cardano/Api/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ import Cardano.Api
, Witness (..)
, byronAddressInEra
, collectTxBodyScriptWitnesses
, createAndValidateTransactionBody
, createTransactionBody
, forEraMaybeEon
, hashScript
, languageOfScriptLanguageInEra
Expand All @@ -245,7 +245,6 @@ import Cardano.Api
, scriptLanguageSupportedInEra
, shelleyAddressInEra
, validateAndHashStakePoolMetadata
, valueFromList
)
import Cardano.Api.Byron
( KeyWitness (ByronKeyWitness)
Expand Down Expand Up @@ -340,6 +339,9 @@ import Data.Word
, Word32
, Word64
)
import GHC.IsList
( fromList
)
import Network.Socket
( PortNumber
)
Expand Down Expand Up @@ -760,7 +762,7 @@ genValueForTxOut = do
]
assetQuantities <- infiniteListOf genUnsignedQuantity
ada <- fromIntegral <$> genCoinForTxOutAdaValue
return $ valueFromList $ (AdaAssetId, ada) : zip assetIds assetQuantities
return $ fromList $ (AdaAssetId, ada) : zip assetIds assetQuantities

-- | Generate a 'Value' which could represent the balance of a partial
-- transaction, where both ada and other assets can be included, and quantities
Expand All @@ -779,13 +781,13 @@ genSignedValue = do
[ genCoin
, negate <$> genCoin
]
return $ valueFromList $ (AdaAssetId, ada) : zip assetIds assetQuantities
return $ fromList $ (AdaAssetId, ada) : zip assetIds assetQuantities

-- | Generate a 'Value' suitable for minting, i.e. non-ADA asset ID and a
-- positive or negative quantity.
genValueForMinting :: Gen Value
genValueForMinting =
valueFromList <$> listOf ((,) <$> genAssetIdNoAda <*> genSignedQuantity)
fromList <$> listOf ((,) <$> genAssetIdNoAda <*> genSignedQuantity)

genTxMintValue :: forall era. CardanoEra era -> Gen (TxMintValue BuildTx era)
genTxMintValue era = withEraWitness era $ \supported ->
Expand Down Expand Up @@ -1852,7 +1854,7 @@ genTxBodyContent era = withEraWitness era $ \sbe -> do

genTxBody :: CardanoEra era -> Gen (TxBody era)
genTxBody era = withEraWitness era $ \se -> do
res <- createAndValidateTransactionBody se <$> genTxBodyContent era
res <- createTransactionBody se <$> genTxBodyContent era
case res of
Left err -> error (displayError err)
Right txBody -> pure txBody
Expand All @@ -1864,7 +1866,7 @@ displayError = show
-- balancing.
genTxBodyForBalancing :: CardanoEra era -> Gen (TxBody era)
genTxBodyForBalancing era = withEraWitness era $ \se -> do
res <- createAndValidateTransactionBody se <$> genStrippedContent
res <- createTransactionBody se <$> genStrippedContent
case res of
Left err -> error (displayError err)
Right txBody -> pure txBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ import qualified Cardano.Wallet.Primitive.Types.TokenBundle as TokenBundle
import qualified Cardano.Wallet.Primitive.Types.TokenPolicyId as W
import qualified Cardano.Wallet.Primitive.Types.TokenQuantity as W
import qualified Cardano.Wallet.Primitive.Types.Tx.TxOut as W
import qualified GHC.IsList as GHC
( toList
)

{-# INLINABLE getOutputs #-}
getOutputs :: forall era . IsEra era => Outputs era -> [W.TxOut]
Expand Down Expand Up @@ -149,7 +152,7 @@ fromCardanoValue = uncurry TokenBundle.fromFlatList . extract
where
extract value =
( fromCardanoLovelace $ Cardano.selectLovelace value
, mkBundle $ Cardano.valueToList value
, mkBundle $ GHC.toList value
)

-- Do Integer to Natural conversion. Quantities from ledger TxOuts can
Expand Down
3 changes: 2 additions & 1 deletion lib/primitive/lib/Cardano/Wallet/Primitive/Ledger/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ import qualified Data.ListMap as ListMap
import qualified Data.Map.Strict as Map
import qualified Data.Percentage as Percentage
import qualified Data.Set as Set
import qualified GHC.IsList as GHC
import qualified Ouroboros.Consensus.Protocol.Praos as Consensus
import qualified Ouroboros.Consensus.Protocol.Praos.Header as Consensus
import qualified Ouroboros.Consensus.Protocol.TPraos as Consensus
Expand Down Expand Up @@ -935,7 +936,7 @@ toCardanoTxOut era refScriptM = case era of
]

toCardanoValue :: TokenBundle.TokenBundle -> Cardano.Value
toCardanoValue tb = Cardano.valueFromList $
toCardanoValue tb = GHC.fromList $
(Cardano.AdaAssetId, coinToQuantity coin) :
map (bimap toCardanoAssetId toQuantity) bundle
where
Expand Down
Loading
Loading