Skip to content

Commit

Permalink
Add inlineDatumRaw to transaction outputs in API (#1684)
Browse files Browse the repository at this point in the history
Addresses #1543 and tests whether
IntersectMBO/cardano-api#632 results in `GET
/snapshot/utxo` to contain `inlineDatumRaw`.

Bonus: First step on consolidating `TxOut` and `UTxO` generators
(deduplicating and moving them to a common module)

TODO: Somehow get
IntersectMBO/cardano-api@17eb46f
into this branch. Most likely requiring #1680 (which updates to most
recent `cardano-api` release `9.30`) and a `source-repository-package`
onto some unreleased cardano-api.

---

* [x] CHANGELOG updated or not needed
* [x] Documentation updated or not needed
* [x] Haddocks updated or not needed
* [x] No new TODOs introduced or explained herafter
  • Loading branch information
locallycompact authored Oct 9, 2024
2 parents 3bd4fc3 + 73adb2d commit 7dc7899
Show file tree
Hide file tree
Showing 69 changed files with 52,967 additions and 48,084 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ changes.

- Add **Blockfrost Mode** to `hydra-chain-observer`, to follow the chain via Blockfrost API.

- Add `inlineDatumRaw` to transaction outputs on the `hydra-node` API.

## [0.19.0] - 2024-09-13

- Tested with `cardano-node 9.1.1` and `cardano-cli 9.2.1.0`
Expand Down
7 changes: 7 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ test-show-details: direct

program-options
ghc-options: -fwrite-ide-info

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-api
tag: 00f025d1fda127d0f7b2e69227e298199bea1fe1
--sha256: sha256-GttvKWo+2SytPW59a1JIYSpdlTr+7mcWvvK+EPAgH/k=
subdir: cardano-api
2 changes: 1 addition & 1 deletion hydra-cardano-api/hydra-cardano-api.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: hydra-cardano-api
version: 0.19.0
version: 0.20.0
synopsis: A Haskell API for Cardano, tailored to the Hydra project.
author: IOG
copyright: 2022 IOG
Expand Down
8 changes: 4 additions & 4 deletions hydra-cardano-api/src/Hydra/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import Cardano.Api as X hiding (
blue,
createAndValidateTransactionBody,
defaultTxBodyContent,
fromLedgerUTxO,
fromLedgerValue,
green,
makeShelleyKeyWitness,
Expand All @@ -83,16 +84,12 @@ import Cardano.Api as X hiding (
toLedgerValue,
(<+>),
)
import Cardano.Api.Byron as X (
Address (..),
)
import Cardano.Api.Experimental as X (UnsignedTx (..))
import Cardano.Api.Ledger as X (
PParams,
)
import Cardano.Api.Shelley as X (
AcquiringFailure (..),
Address (..),
Hash (HeaderHash),
Key (..),
PlutusScriptOrReferenceInput (PScript),
Expand Down Expand Up @@ -397,6 +394,7 @@ pattern TxBodyContent ::
TxValidityUpperBound ->
TxMetadataInEra ->
TxAuxScripts ->
BuildTxWith buidl (TxSupplementalDatums Era) ->
TxExtraKeyWitnesses ->
BuildTxWith buidl (Maybe (LedgerProtocolParameters Era)) ->
TxWithdrawals buidl Era ->
Expand All @@ -421,6 +419,7 @@ pattern TxBodyContent
, txValidityUpperBound
, txMetadata
, txAuxScripts
, txSupplementalDatums
, txExtraKeyWits
, txProtocolParams
, txWithdrawals
Expand All @@ -445,6 +444,7 @@ pattern TxBodyContent
txValidityUpperBound
txMetadata
txAuxScripts
txSupplementalDatums
txExtraKeyWits
txProtocolParams
txWithdrawals
Expand Down
1 change: 0 additions & 1 deletion hydra-cardano-api/src/Hydra/Cardano/Api/Address.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module Hydra.Cardano.Api.Address where

import Hydra.Cardano.Api.Prelude

import Cardano.Api.Byron (Address (..))
import Cardano.Binary (unsafeDeserialize')
import Cardano.Chain.Common qualified as Ledger
import Data.ByteString qualified as BS
Expand Down
1 change: 0 additions & 1 deletion hydra-cardano-api/src/Hydra/Cardano/Api/AddressInEra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Hydra.Cardano.Api.AddressInEra where

import Hydra.Cardano.Api.Prelude

import Cardano.Api.Byron (Address (..))
import Cardano.Ledger.Address qualified as Ledger
import Cardano.Ledger.BaseTypes qualified as Ledger
import Cardano.Ledger.Credential qualified as Ledger
Expand Down
3 changes: 1 addition & 2 deletions hydra-cardano-api/src/Hydra/Cardano/Api/TxOut.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ modifyTxOutAddress fn (TxOut addr value dat ref) =
-- | Alter the value of a 'TxOut' with the given transformation.
modifyTxOutValue ::
IsMaryBasedEra era =>
IsShelleyBasedEra era =>
(Value -> Value) ->
TxOut ctx era ->
TxOut ctx era
Expand Down Expand Up @@ -159,7 +158,7 @@ toLedgerTxOut =
-- Plutus addresses are stripped off it.
fromPlutusTxOut ::
forall era.
(IsMaryBasedEra era, IsAlonzoBasedEra era, IsBabbageBasedEra era, IsShelleyBasedEra era) =>
IsBabbageBasedEra era =>
Network ->
Plutus.TxOut ->
Maybe (TxOut CtxUTxO era)
Expand Down
1 change: 0 additions & 1 deletion hydra-cardano-api/src/Hydra/Cardano/Api/TxOutValue.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Hydra.Cardano.Api.Prelude
-- | Inject some 'Value' into a 'TxOutValue'
mkTxOutValue ::
forall era.
IsShelleyBasedEra era =>
IsMaryBasedEra era =>
Value ->
TxOutValue era
Expand Down
2 changes: 1 addition & 1 deletion hydra-cardano-api/src/Hydra/Cardano/Api/UTxO.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Hydra.Cardano.Api.UTxO where

import Hydra.Cardano.Api.Prelude
import Hydra.Cardano.Api.Prelude hiding (fromLedgerUTxO)
import Hydra.Cardano.Api.TxId (toLedgerTxId)
import Hydra.Cardano.Api.TxIn (fromLedgerTxIn, toLedgerTxIn, txIns')
import Hydra.Cardano.Api.TxOut (fromLedgerTxOut, toLedgerTxOut)
Expand Down
2 changes: 2 additions & 0 deletions hydra-cluster/test/Test/EndToEndSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ initAndClose tmpDir tracer clusterIx hydraScriptsTxId node@RunningNode{nodeSocke
, "datum" .= Null
, "datumhash" .= Null
, "inlineDatum" .= Null
, "inlineDatumRaw" .= Null
, "referenceScript" .= Null
]
)
Expand All @@ -713,6 +714,7 @@ initAndClose tmpDir tracer clusterIx hydraScriptsTxId node@RunningNode{nodeSocke
, "datum" .= Null
, "datumhash" .= Null
, "inlineDatum" .= Null
, "inlineDatumRaw" .= Null
, "referenceScript" .= Null
]
)
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 7dc7899

Please sign in to comment.