Skip to content

Commit 7f66b8e

Browse files
authored
Merge pull request #1675 from Plutonomicon/blockfrost-provider-extraction
Extract blockfrost provider
2 parents 31e48fb + 2225f6b commit 7f66b8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+274
-2807
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
105105
- Ignore **any** tx evaluation errors if tx marked invalid. Previously, certain internal evaluation errors were not properly handled, leading to unexpected behavior for a subset of explicitly marked "invalid" transactions. ([#1668](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1668))
106106
- `Provider` (previously called `QueryHandle`) is extracted to its own package [purescript-cardano-provider](https://github.com/mlabs-haskell/purescript-cardano-provider) using module names in the format `Cardano.Provider.*` ([#1671](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1671))
107107
- Switched from WebSocket to HTTP when interfacing with Ogmios. Note: Mempool functionality still uses WebSocket, as it requires a persistent connection to track state. ([#1575](https://github.com/Plutonomicon/cardano-transaction-lib/issues/1575))
108+
- Blockfrost Provider has been extracted to a separate package [purescript-cardano-blockfrost-provider](https://github.com/mlabs-haskell/purescript-cardano-blockfrost-provider) using module names in the format `Cardano.Blockfrost.*` ([#1661](https://github.com/Plutonomicon/cardano-transaction-lib/issues/1661))
108109

109110
### Fixed
110111

packages.dhall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let upstream =
22
-- https://github.com/mlabs-haskell/purescript-cardano-package-set
3-
https://raw.githubusercontent.com/mlabs-haskell/purescript-cardano-package-set/v1.1.0/packages.dhall sha256:6197d808325030415858c597b61c83320344bf899107b83f7dfe366de4650aa6
3+
https://raw.githubusercontent.com/mlabs-haskell/purescript-cardano-package-set/v1.2.0/packages.dhall sha256:1879aeee12ef41d5f39ed8b530efa817c747366553b2fc90981ad4e8c21fc5d8
44

55
in upstream

spago-packages.nix

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

spago.dhall

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
, "arrays"
1212
, "avar"
1313
, "bifunctors"
14-
, "bignumber"
1514
, "bytearrays"
1615
, "cardano-hd-wallet"
1716
, "cardano-key-wallet"
@@ -20,6 +19,7 @@
2019
, "cardano-serialization-lib"
2120
, "cardano-transaction-builder"
2221
, "cardano-types"
22+
, "cardano-blockfrost-provider"
2323
, "cardano-provider"
2424
, "checked-exceptions"
2525
, "cip30"
@@ -41,7 +41,6 @@
4141
, "foreign-object"
4242
, "formatters"
4343
, "functions"
44-
, "heterogeneous"
4544
, "http-methods"
4645
, "identity"
4746
, "integers"
@@ -51,7 +50,6 @@
5150
, "lists"
5251
, "literals"
5352
, "maybe"
54-
, "media-types"
5553
, "monad-logger"
5654
, "mote"
5755
, "mote-testplan"
@@ -84,7 +82,6 @@
8482
, "quickcheck"
8583
, "quickcheck-combinators"
8684
, "random"
87-
, "rationals"
8885
, "record"
8986
, "refs"
9087
, "safe-coerce"

src/Contract/Numeric/Rational.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Contract.Numeric.Rational
33
( module Rational
44
) where
55

6-
import Ctl.Internal.Types.Rational
6+
import Cardano.Types.Rational
77
( class RationalComponent
88
, Rational
99
, denominator

src/Contract/ProtocolParameters.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ module Contract.ProtocolParameters
22
( getProtocolParameters
33
) where
44

5+
import Cardano.Types.ProtocolParameters (ProtocolParameters)
56
import Contract.Monad (Contract)
67
import Ctl.Internal.Contract (getProtocolParameters) as Contract
7-
import Ctl.Internal.Types.ProtocolParameters (ProtocolParameters)
88

99
-- | Returns the `ProtocolParameters` from the `Contract` environment.
1010
-- | Note that this is not necessarily the current value from the ledger.

src/Contract/Time.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ import Cardano.Types.EraSummaries
3333
, SlotLength(SlotLength)
3434
) as ExportEraSummaries
3535
import Cardano.Types.EraSummaries (EraSummaries, EraSummary)
36+
import Cardano.Types.SystemStart (SystemStart)
37+
import Cardano.Types.SystemStart (SystemStart(SystemStart)) as ExportSystemStart
3638
import Contract.Chain (getTip) as Chain
3739
import Contract.Log (logInfo')
3840
import Contract.Monad (Contract, liftContractM, liftedE)
@@ -97,8 +99,6 @@ import Ctl.Internal.Types.Interval
9799
, toOnchainPosixTimeRange
98100
, upperBound
99101
) as Interval
100-
import Ctl.Internal.Types.SystemStart (SystemStart)
101-
import Ctl.Internal.Types.SystemStart (SystemStart(SystemStart)) as ExportSystemStart
102102
import Data.Array as Array
103103
import Data.Foldable (find)
104104
import Data.Maybe (Maybe(Just, Nothing))

src/Internal/BalanceTx/BalanceTx.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ import Cardano.Types.Address (Address)
4141
import Cardano.Types.BigNum as BigNum
4242
import Cardano.Types.Coin as Coin
4343
import Cardano.Types.OutputDatum (OutputDatum(OutputDatum))
44+
import Cardano.Types.ProtocolParameters
45+
( ProtocolParameters(ProtocolParameters)
46+
)
4447
import Cardano.Types.TransactionBody (_votingProposals)
4548
import Cardano.Types.TransactionInput (TransactionInput)
4649
import Cardano.Types.TransactionUnspentOutput as TransactionUnspentOutputs
@@ -117,9 +120,6 @@ import Ctl.Internal.Partition
117120
, equipartitionValueWithTokenQuantityUpperBound
118121
, partition
119122
)
120-
import Ctl.Internal.Types.ProtocolParameters
121-
( ProtocolParameters(ProtocolParameters)
122-
)
123123
import Ctl.Internal.Types.Val (Val(Val), pprintVal)
124124
import Ctl.Internal.Types.Val as Val
125125
import Data.Array as Array

src/Internal/Contract.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module Ctl.Internal.Contract (getChainTip, getProtocolParameters) where
33
import Prelude
44

55
import Cardano.Types.Chain (Tip)
6+
import Cardano.Types.ProtocolParameters (ProtocolParameters)
67
import Control.Monad.Reader.Class (asks)
78
import Ctl.Internal.Contract.Monad (Contract, getProvider)
8-
import Ctl.Internal.Types.ProtocolParameters (ProtocolParameters)
99
import Data.Either (either)
1010
import Effect.Aff.Class (liftAff)
1111
import Effect.Class (liftEffect)

src/Internal/Contract/Monad.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ module Ctl.Internal.Contract.Monad
2222

2323
import Prelude
2424

25+
import Cardano.Blockfrost.Service
26+
( BlockfrostServiceM
27+
, runBlockfrostServiceM
28+
)
29+
import Cardano.Blockfrost.Service as Blockfrost
2530
import Cardano.Provider.Error (ClientError)
2631
import Cardano.Provider.Type (Provider)
2732
import Cardano.Types (NetworkId(TestnetId, MainnetId), TransactionHash, UtxoMap)
33+
import Cardano.Types.ProtocolParameters (ProtocolParameters)
34+
import Cardano.Types.SystemStart (SystemStart)
2835
import Contract.Prelude (liftEither)
2936
import Control.Alt (class Alt)
3037
import Control.Alternative (class Alternative)
@@ -61,13 +68,6 @@ import Ctl.Internal.QueryM.Ogmios.Types
6168
( OgmiosDecodeError
6269
, pprintOgmiosDecodeError
6370
)
64-
import Ctl.Internal.Service.Blockfrost
65-
( BlockfrostServiceM
66-
, runBlockfrostServiceM
67-
)
68-
import Ctl.Internal.Service.Blockfrost as Blockfrost
69-
import Ctl.Internal.Types.ProtocolParameters (ProtocolParameters)
70-
import Ctl.Internal.Types.SystemStart (SystemStart)
7171
import Ctl.Internal.Types.UsedTxOuts (UsedTxOuts, isTxOutRefUsed, newUsedTxOuts)
7272
import Ctl.Internal.Wallet (Wallet(GenericCip30))
7373
import Ctl.Internal.Wallet.Spec (WalletSpec, mkWalletBySpec)

0 commit comments

Comments
 (0)