Skip to content

Commit 7599eb6

Browse files
committed
Switch to purescript-cardano-package-set v3.0.0
1 parent aa20a2b commit 7599eb6

File tree

9 files changed

+29
-67
lines changed

9 files changed

+29
-67
lines changed

packages.dhall

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,6 @@
11
let upstream =
22
-- https://github.com/mlabs-haskell/purescript-cardano-package-set
3-
https://raw.githubusercontent.com/mlabs-haskell/purescript-cardano-package-set/v2.0.0/packages.dhall
4-
sha256:89e383ba2cceff5b668cefae59aae352e60fb28543f9dc3fb198a0231d56d8e0
3+
https://raw.githubusercontent.com/mlabs-haskell/purescript-cardano-package-set/v3.0.0/packages.dhall
4+
sha256:53f8de47606b6cb349432c2f2f03e656b204ebe132ef2d39d76339d9d97620ee
55

6-
let additions =
7-
{ cardano-transaction-balancer =
8-
{ dependencies =
9-
[ "aff"
10-
, "ansi"
11-
, "arrays"
12-
, "bifunctors"
13-
, "bytearrays"
14-
, "cardano-data-lite"
15-
, "cardano-kupmios-provider"
16-
, "cardano-provider"
17-
, "cardano-transaction-builder"
18-
, "cardano-types"
19-
, "console"
20-
, "effect"
21-
, "either"
22-
, "exceptions"
23-
, "foldable-traversable"
24-
, "integers"
25-
, "js-bigints"
26-
, "js-date"
27-
, "lattice"
28-
, "lists"
29-
, "literals"
30-
, "maybe"
31-
, "monad-logger"
32-
, "newtype"
33-
, "ordered-collections"
34-
, "parallel"
35-
, "partial"
36-
, "prelude"
37-
, "profunctor"
38-
, "profunctor-lenses"
39-
, "quickcheck"
40-
, "random"
41-
, "strings"
42-
, "stringutils"
43-
, "these"
44-
, "transformers"
45-
, "tuples"
46-
, "uint"
47-
, "unsafe-coerce"
48-
]
49-
, repo =
50-
"https://github.com/mlabs-haskell/purescript-cardano-transaction-balancer"
51-
, version = "2762e726922a65c772f6f21d547d6bc8f9859e4e"
52-
}
53-
}
54-
55-
in (upstream // additions)
6+
in upstream

src/Internal/Test/E2E/Feedback/Browser.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ module Ctl.Internal.Test.E2E.Feedback.Browser
1111
import Prelude
1212

1313
import Aeson (decodeAeson, encodeAeson, jsonToAeson, stringifyAeson)
14-
import Cardano.Kupmios.KupmiosM (ClusterSetup)
1514
import Ctl.Internal.FfiHelpers (MaybeFfiHelper, maybeFfiHelper)
1615
import Ctl.Internal.Helpers (liftedM)
1716
import Ctl.Internal.Test.E2E.Feedback (BrowserEvent)
17+
import Ctl.Internal.Test.E2E.Types (ClusterSetup)
1818
import Data.Argonaut (Json)
1919
import Data.Either (hush)
2020
import Data.Maybe (Maybe)

src/Internal/Test/E2E/Feedback/Node.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ module Ctl.Internal.Test.E2E.Feedback.Node
1111
import Prelude
1212

1313
import Aeson (decodeAeson, encodeAeson, parseJsonStringToAeson, stringifyAeson)
14-
import Cardano.Kupmios.KupmiosM (ClusterSetup)
1514
import Ctl.Internal.Helpers (liftEither)
1615
import Ctl.Internal.Test.E2E.Feedback (BrowserEvent(Failure, Success))
16+
import Ctl.Internal.Test.E2E.Types (ClusterSetup)
1717
import Data.Array as Array
1818
import Data.Either (Either(Left), hush, note)
1919
import Data.Foldable (and)

src/Internal/Test/E2E/Route.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Ctl.Internal.Test.E2E.Route
1010

1111
import Prelude
1212

13-
import Cardano.Kupmios.KupmiosM (ClusterSetup)
1413
import Cardano.Types (NetworkId(TestnetId))
1514
import Cardano.Types.PrivateKey (PrivateKey)
1615
import Cardano.Types.PrivateKey as PrivateKey
@@ -31,6 +30,7 @@ import Ctl.Internal.Contract.ProviderBackend (mkCtlBackendParams)
3130
import Ctl.Internal.Helpers (liftEither)
3231
import Ctl.Internal.Test.E2E.Feedback.Browser (getClusterSetupRepeatedly)
3332
import Ctl.Internal.Test.E2E.Feedback.Hooks (addE2EFeedbackHooks)
33+
import Ctl.Internal.Test.E2E.Types (ClusterSetup)
3434
import Ctl.Internal.Wallet.Spec (WalletSpec(ConnectToGenericCip30))
3535
import Data.Array (last)
3636
import Data.Array as Array

src/Internal/Test/E2E/Runner.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Prelude
1010
import Affjax (defaultRequest) as Affjax
1111
import Affjax (printError)
1212
import Affjax.ResponseFormat as Affjax.ResponseFormat
13-
import Cardano.Kupmios.KupmiosM (ClusterSetup)
1413
import Cardano.Provider.Affjax (request) as Affjax
1514
import Cardano.Types.BigNum as BigNum
1615
import Cardano.Types.PrivateKey as PrivateKey
@@ -46,6 +45,7 @@ import Ctl.Internal.Test.E2E.Types
4645
( Browser
4746
, BrowserArg
4847
, ChromeUserDataDir
48+
, ClusterSetup
4949
, E2ETest
5050
, E2ETestRuntime
5151
, E2EWallet(NoWallet, LocalTestnet, WalletExtension)

src/Internal/Test/E2E/Types.purs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-- | Common types for E2E tests.
22
module Ctl.Internal.Test.E2E.Types
33
( Browser
4+
, ClusterSetup
45
, TmpDir
56
, SettingsArchive
67
, SettingsArchiveUrl
@@ -26,6 +27,8 @@ module Ctl.Internal.Test.E2E.Types
2627

2728
import Prelude
2829

30+
import Cardano.Provider (ServerConfig)
31+
import Cardano.Wallet.Key (PrivatePaymentKey, PrivateStakeKey)
2932
import Control.Alt ((<|>))
3033
import Data.Either (hush)
3134
import Data.Generic.Rep (class Generic)
@@ -172,3 +175,15 @@ type SomeWallet =
172175
, confirmAccess :: ExtensionId -> RunningE2ETest -> Aff Unit
173176
, sign :: ExtensionId -> WalletPassword -> RunningE2ETest -> Aff Unit
174177
}
178+
179+
-- | Cluster setup contains everything that is needed to run a `Contract` on
180+
-- | a local cluster: parameters to connect to the services and private keys
181+
-- | that are pre-funded with Ada on that cluster
182+
type ClusterSetup =
183+
{ ogmiosConfig :: ServerConfig
184+
, kupoConfig :: ServerConfig
185+
, keys ::
186+
{ payment :: PrivatePaymentKey
187+
, stake :: Maybe PrivateStakeKey
188+
}
189+
}

src/Internal/TxOutput.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Prelude
1111

1212
import Cardano.AsCbor (decodeCbor, encodeCbor)
1313
import Cardano.Data.Lite (fromBytes, toBytes)
14-
import Cardano.Provider.TxEvaluation (OgmiosTxOut, OgmiosTxOutRef)
14+
import Cardano.Provider (OgmiosTxOut, OgmiosTxOutRef)
1515
import Cardano.Types
1616
( DataHash
1717
, PlutusData

test/Ogmios/Aeson.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import Aeson as Aeson
1616
import Cardano.Kupmios.Ogmios.Types
1717
( class DecodeOgmios
1818
, OgmiosDecodeError(ErrorResponse)
19-
, OgmiosTxEvaluationR
2019
, SubmitTxR
2120
, decodeOgmios
2221
)
@@ -66,7 +65,7 @@ tested =
6665
, ( "queryLedgerState/rewardAccountSummaries" /\ check
6766
(Proxy :: _ O.DelegationsAndRewardsR)
6867
)
69-
, ("evaluateTransaction" /\ check (Proxy :: _ OgmiosTxEvaluationR))
68+
, ("evaluateTransaction" /\ check (Proxy :: _ O.TxEvaluationR))
7069
, ("submitTransaction" /\ check (Proxy :: _ SubmitTxR))
7170
, ("hasTransaction" /\ check (Proxy :: _ Mempool.HasTxR))
7271
, ("sizeOfMempool" /\ check (Proxy :: _ Mempool.MempoolSizeAndCapacity))

test/Ogmios/EvaluateTx.purs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ import Prelude
44

55
import Cardano.Kupmios.Ogmios.Types
66
( OgmiosDecodeError(InvalidRpcResponse)
7-
, OgmiosTxEvaluationR
87
, decodeOgmios
98
)
10-
import Cardano.Provider.TxEvaluation
9+
import Cardano.Provider
1110
( ExecutionUnits
1211
, RedeemerPointer
1312
, TxEvaluationFailure(UnparsedError, ScriptFailures)
@@ -21,7 +20,6 @@ import Data.Argonaut.Decode.Error (JsonDecodeError(TypeMismatch))
2120
import Data.Either (Either(Left, Right))
2221
import Data.Map as Map
2322
import Data.Maybe (fromJust)
24-
import Data.Newtype (unwrap)
2523
import Data.Tuple.Nested (type (/\), (/\))
2624
import Effect.Aff (Aff)
2725
import Effect.Class (liftEffect)
@@ -42,7 +40,7 @@ suite = do
4240
group "Decoding EvaluateTx response" do
4341
test "Successfully decodes a valid response" do
4442
txEvalR :: Either OgmiosDecodeError TxEvaluationR <-
45-
(map (\(r :: OgmiosTxEvaluationR) -> unwrap r) <<< decodeOgmios) <$>
43+
decodeOgmios <$>
4644
liftEffect
4745
ogmiosEvaluateTxValidRespFixture
4846
txEvalR `shouldSatisfy` case _ of
@@ -55,8 +53,7 @@ suite = do
5553
body <- liftEffect ogmiosEvaluateTxInvalidPointerFormatFixture
5654
let
5755
(txEvalR :: Either OgmiosDecodeError TxEvaluationR) =
58-
(map (\(r :: OgmiosTxEvaluationR) -> unwrap r) <<< decodeOgmios)
59-
body
56+
decodeOgmios body
6057
txEvalR `shouldSatisfy` case _ of
6158
Left (InvalidRpcResponse (TypeMismatch errMsg)) -> errMsg ==
6259
"Expected redeemer to be one of: (spend|mint|publish|withdraw|vote|propose)"
@@ -65,7 +62,7 @@ suite = do
6562
test "Successfully decodes a failed execution response (Incompatible era)"
6663
do
6764
txEvalR :: Either OgmiosDecodeError TxEvaluationR <-
68-
(map (\(r :: OgmiosTxEvaluationR) -> unwrap r) <<< decodeOgmios) <$>
65+
decodeOgmios <$>
6966
liftEffect
7067
ogmiosEvaluateTxFailIncompatibleEraFixture
7168
txEvalR `shouldSatisfy` case _ of
@@ -74,7 +71,7 @@ suite = do
7471

7572
test "Successfully decodes a failed execution response (Script errors)" do
7673
txEvalR :: Either OgmiosDecodeError TxEvaluationR <-
77-
(map (\(r :: OgmiosTxEvaluationR) -> unwrap r) <<< decodeOgmios) <$>
74+
decodeOgmios <$>
7875
liftEffect
7976
ogmiosEvaluateTxFailScriptErrorsFixture
8077
txEvalR `shouldSatisfy` case _ of

0 commit comments

Comments
 (0)