Skip to content

Commit bc92138

Browse files
committed
Bump cardano-node to v10.1.2, Fix HydraTxOut json codec
1 parent 81cff66 commit bc92138

File tree

4 files changed

+62
-66
lines changed

4 files changed

+62
-66
lines changed

example/minimal/docker/cluster/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
cardano-node:
3-
image: ghcr.io/intersectmbo/cardano-node:9.2.0
3+
image: ghcr.io/intersectmbo/cardano-node:10.1.2
44
environment:
55
- NETWORK=preprod
66
volumes:

flake.lock

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

flake.nix

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@
88

99
inputs = {
1010
nixpkgs.follows = "ctl/nixpkgs";
11-
cardano-node.url = "github:input-output-hk/cardano-node/9.2.0";
12-
ctl.url = "github:Plutonomicon/cardano-transaction-lib/4bae6a202f3c77952d6067f94d8ae63cb74f3c0f";
13-
ctl.inputs.cardano-node.follows = "cardano-node";
11+
cardano-node.url = "github:input-output-hk/cardano-node/10.1.2";
12+
cardano-configurations = {
13+
url = "github:input-output-hk/cardano-configurations?rev=3c5f35bda1b8fd29ab310ad222403a9167f512de";
14+
flake = false;
15+
};
16+
ctl = {
17+
url = "github:Plutonomicon/cardano-transaction-lib/4bae6a202f3c77952d6067f94d8ae63cb74f3c0f";
18+
inputs = {
19+
cardano-node.follows = "cardano-node";
20+
cardano-configurations.follows = "cardano-configurations";
21+
};
22+
};
1423
hydra.url = "github:input-output-hk/hydra/0.19.0";
1524
};
1625

src/Internal/Types/UtxoMap.purs

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ txOutCodec =
129129
maybe (OutputDatumHash <$> rec.datumhash) (Just <<< OutputDatum)
130130
rec.inlineDatum
131131
, scriptRef:
132-
rec.referenceScript.script >>= \{ cborHex: scriptCbor, "type": scriptLang } ->
132+
rec.referenceScript >>= \{ script: { cborHex: scriptCbor, "type": scriptLang } } ->
133133
case scriptLang of
134134
SimpleScript -> NativeScriptRef <$> decodeCbor scriptCbor
135135
-- TODO: Plutus version encoded in CBOR?
@@ -145,21 +145,22 @@ txOutCodec =
145145
, datum: Nothing -- FIXME: should we resolve the datum?
146146
, datumhash: outputDatumDataHash =<< rec.datum
147147
, referenceScript:
148-
{ script:
149-
rec.scriptRef <#> case _ of
150-
NativeScriptRef nativeScript ->
151-
{ cborHex: encodeCbor nativeScript
152-
, "type": SimpleScript
153-
}
154-
PlutusScriptRef plutusScript@(PlutusScript (_ /\ scriptLang)) ->
155-
{ cborHex: encodeCbor plutusScript
156-
, "type":
157-
case scriptLang of
158-
PlutusV1 -> PlutusScriptV1
159-
PlutusV2 -> PlutusScriptV2
160-
PlutusV3 -> PlutusScriptV3
161-
}
162-
}
148+
rec.scriptRef <#> \scriptRef ->
149+
{ script:
150+
case scriptRef of
151+
NativeScriptRef nativeScript ->
152+
{ cborHex: encodeCbor nativeScript
153+
, "type": SimpleScript
154+
}
155+
PlutusScriptRef plutusScript@(PlutusScript (_ /\ scriptLang)) ->
156+
{ cborHex: encodeCbor plutusScript
157+
, "type":
158+
case scriptLang of
159+
PlutusV1 -> PlutusScriptV1
160+
PlutusV2 -> PlutusScriptV2
161+
PlutusV3 -> PlutusScriptV3
162+
}
163+
}
163164
}
164165

165166
--
@@ -173,7 +174,7 @@ type HydraTxOut =
173174
, inlineDatumhash :: Maybe DataHash
174175
, datum :: Maybe PlutusData
175176
, datumhash :: Maybe DataHash
176-
, referenceScript :: { script :: Maybe HydraReferenceScript }
177+
, referenceScript :: Maybe { script :: HydraReferenceScript }
177178
}
178179

179180
hydraTxOutCodec :: CA.JsonCodec HydraTxOut
@@ -186,8 +187,8 @@ hydraTxOutCodec =
186187
, datum: CA.maybe plutusDataCodec
187188
, datumhash: CA.maybe dataHashCodec
188189
, referenceScript:
189-
CA.object "HydraTxOut:referenceScript" $ CAR.record
190-
{ script: CA.maybe hydraRefScriptCodec
190+
CA.maybe $ CA.object "HydraTxOut:referenceScript" $ CAR.record
191+
{ script: hydraRefScriptCodec
191192
}
192193
}
193194

0 commit comments

Comments
 (0)