Skip to content

Commit adac7b9

Browse files
committed
Merge branch 'develop' into dshuiski/1632-no-datum-querying
2 parents 9f4b3df + c3c20a8 commit adac7b9

File tree

15 files changed

+197
-36
lines changed

15 files changed

+197
-36
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
128128

129129
- Fixed transaction witness set 'attach' functions. Previously, the updated witness set was incorrectly appended to the existing set, causing performance degradation when processing constraints for complex transactions. ([#1653](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1653))
130130
- Fixed a critical bug where Blockfrost `getUtxo` would also return **spent** outputs ([#1664](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1664))
131+
- Fixed `onClusterStartup` hook so it is now correctly invoked when using cardano-testnet ([#1651](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1651))
132+
- Removed the `privateKeys` and `privateKeysDirectory` fields from the `ClusterParameters` record to ensure compatibility with the new cardano-testnet environment
131133

132134
## [v9.3.1]
133135

packages.dhall

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +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/v3.0.0/packages.dhall
4-
sha256:53f8de47606b6cb349432c2f2f03e656b204ebe132ef2d39d76339d9d97620ee
3+
https://raw.githubusercontent.com/mlabs-haskell/purescript-cardano-package-set/v3.1.0/packages.dhall
4+
sha256:0d8a7ca4e8ecfc8d1d795a989b76364caa9583d60e765c490cfa215a8824c246
55

66
in upstream

spago-packages.nix

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Contract/BalanceTxConstraints.purs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import Cardano.Transaction.Balancer.Constraints
66
( BalanceTxConstraintsBuilder
77
, BalancerConfig(BalancerConfig)
88
, BalancerConstraints(BalancerConstraints)
9+
, UtxoPredicate
910
, mustGenChangeOutsWithMaxTokenQuantity
1011
, mustNotSpendUtxoWithOutRef
12+
, mustNotSpendUtxosWhere
1113
, mustNotSpendUtxosWithOutRefs
1214
, mustSendChangeToAddress
1315
, mustSendChangeWithDatum

src/Internal/Contract/Hooks.purs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ module Ctl.Internal.Contract.Hooks
66

77
import Prelude
88

9-
import Cardano.Types.PrivateKey (PrivateKey)
109
import Cardano.Types.Transaction (Transaction)
1110
import Data.Maybe (Maybe(Nothing))
1211
import Effect (Effect)
1312
import Effect.Exception (Error)
13+
import Node.Path (FilePath)
1414

1515
type Hooks =
1616
{ beforeSign :: Maybe (Effect Unit)
@@ -22,10 +22,8 @@ type Hooks =
2222
}
2323

2424
type ClusterParameters =
25-
{ privateKeys :: Array PrivateKey
26-
, nodeSocketPath :: String
27-
, nodeConfigPath :: String
28-
, privateKeysDirectory :: String
25+
{ nodeSocketPath :: FilePath
26+
, nodeConfigPath :: FilePath
2927
}
3028

3129
emptyHooks :: Hooks

src/Internal/Testnet/Contract.purs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import Control.Monad.State (State, execState, modify_)
4444
import Control.Monad.Trans.Class (lift)
4545
import Control.Monad.Writer (censor, execWriterT, tell)
4646
import Control.Parallel (parTraverse)
47+
import Ctl.Internal.Contract.Hooks (ClusterParameters)
4748
import Ctl.Internal.Test.ContractTest
4849
( ContractTest(ContractTest)
4950
, ContractTestPlan(ContractTestPlan)
@@ -62,7 +63,7 @@ import Ctl.Internal.Testnet.DistributeFunds
6263
)
6364
import Ctl.Internal.Testnet.DistributeFunds (Tx(Tx)) as DistrFunds
6465
import Ctl.Internal.Testnet.Server
65-
( StartedTestnetCluster
66+
( StartedTestnetCluster(StartedTestnetCluster)
6667
, makeClusterContractEnv
6768
, mkLogging
6869
, startTestnetCluster
@@ -77,8 +78,8 @@ import Ctl.Internal.Testnet.Utils
7778
import Data.Array (concat, fromFoldable, zip) as Array
7879
import Data.Bifunctor (lmap)
7980
import Data.Map (values) as Map
81+
import Effect.Aff (apathize, try)
8082
import Effect.Aff (bracket) as Aff
81-
import Effect.Aff (try)
8283
import Effect.Exception (error)
8384
import Effect.Ref (Ref)
8485
import Effect.Ref (new, read, write) as Ref
@@ -243,9 +244,17 @@ startTestnetContractEnv
243244
startTestnetContractEnv cfg distr cleanupRef = do
244245
_ <- cleanupOnExit cleanupRef
245246
logging@{ logger } <- liftEffect $ mkLogging cfg
246-
cluster <- startTestnetCluster cfg cleanupRef logger
247+
cluster@(StartedTestnetCluster { paths: { nodeSocketPath, nodeConfigPath } }) <-
248+
startTestnetCluster cfg cleanupRef logger
247249
{ env, printLogs, clearLogs } <- makeClusterContractEnv cleanupRef logging
248250
wallets <- mkWallets env cluster
251+
let
252+
clusterParams :: ClusterParameters
253+
clusterParams =
254+
{ nodeSocketPath
255+
, nodeConfigPath
256+
}
257+
apathize $ liftEffect $ for_ env.hooks.onClusterStartup (_ $ clusterParams)
249258
pure
250259
{ cluster
251260
, env

src/Internal/Testnet/Server.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Ctl.Internal.Testnet.Server
22
( Channels
3-
, StartedTestnetCluster(MkStartedTestnetCluster)
3+
, StartedTestnetCluster(StartedTestnetCluster)
44
, startKupo
55
, startOgmios
66
, startTestnetCluster
@@ -103,7 +103,7 @@ type Channels a =
103103
, stdout :: EventSource a
104104
}
105105

106-
newtype StartedTestnetCluster = MkStartedTestnetCluster
106+
newtype StartedTestnetCluster = StartedTestnetCluster
107107
{ ogmios ::
108108
{ process :: ManagedProcess
109109
, channels :: Channels String
@@ -224,7 +224,7 @@ startTestnetCluster cfg cleanupRef logger = do
224224
kupo <- annotateError "Could not start kupo"
225225
$ startKupo' { paths, workdir: workdirAbsolute }
226226

227-
pure $ MkStartedTestnetCluster
227+
pure $ StartedTestnetCluster
228228
{ paths
229229
, ogmios
230230
, kupo

templates/ctl-scaffold/flake.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/ctl-scaffold/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
type = "github";
1717
owner = "Plutonomicon";
1818
repo = "cardano-transaction-lib";
19-
rev = "7599eb6f57d58d5e2cee4c25c6c768392ea94d6e";
19+
rev = "9f7d48085966a4f4d2c5f1c190dca3cd700a502d";
2020
};
2121
# To use the same version of `nixpkgs` as we do
2222
nixpkgs.follows = "ctl/nixpkgs";

templates/ctl-scaffold/packages.dhall

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

66
let additions =
77
{ cardano-transaction-lib =
@@ -112,7 +112,7 @@ let additions =
112112
, "web-storage"
113113
]
114114
, repo = "https://github.com/Plutonomicon/cardano-transaction-lib.git"
115-
, version = "7599eb6f57d58d5e2cee4c25c6c768392ea94d6e"
115+
, version = "9f7d48085966a4f4d2c5f1c190dca3cd700a502d"
116116
}
117117
}
118118

0 commit comments

Comments
 (0)