Commit 4d4f884
committed
Migrate to experimental TxOut in createCompatibleTx
Adapt to cardano-api PR #1209, which removes the legacy 'TxOut CtxTx era'
from the Compatible and Experimental APIs:
* createCompatibleTx now takes '[Exp.TxOut (ShelleyLedgerEra era)]' plus
a new 'Map L.DataHash (L.Data ...)' of supplemental datum bodies. The
legacy 'TxOut CtxTx era' bundled supplemental datums inside outputs;
'Exp.TxOut' only carries the datum hash, so callers thread the full
datum bodies in explicitly.
* The bridge helpers in 'Cardano.Api.Experimental.Tx'
(fromLegacyTxOut, legacyDatumToDatum, supplementalDatumFromLegacy,
toLedgerDatum, DatumDecodingError) are deleted.
Changes here:
* Add a 'convertLegacyTxOut' helper in
'Cardano.CLI.Compatible.Transaction.TxOut' that maps each legacy
'TxOut CtxTx era' to '(Exp.TxOut, Map DataHash (L.Data ...))' using
'toShelleyTxOutAny' (which already strips supplemental datums to
their hash in the ledger TxOut) and pulls the supplemental datum
bodies into the map.
* Update the 'createCompatibleTx' call in
'Cardano.CLI.Compatible.Transaction.Run' to convert outs at the
boundary and pass the folded 'extraDatums' map.
* Replace 'Exp.fromLegacyTxOut' in 'toTxOutInEra' and
'toTxOutInShelleyBasedEra' with 'convertLegacyTxOut', using
'obtainCommonConstraints' to bridge 'ShelleyLedgerEra ~ LedgerEra'.
* Drop 'TxCmdDatumDecodingError' from 'TxCmdError' since the
underlying 'Exp.DatumDecodingError' is gone and the new conversion
is total.
Temporary cabal.project additions (to be removed once #1209 is merged
and the next cardano-api is published to CHaP):
* source-repository-package pointing at the PR branch, so CI can
build against the unpublished API.
* Per-package '-Wwarn=deprecations -Wwarn=unused-imports' for
cardano-cli. The PR branch is several commits ahead of
cardano-api-11.1.0.0 and surfaces unrelated TxBody/TxBodyContent
deprecations (cardano-api PR #1200) plus a redundant
'Cardano.Ledger.Core' import in 'Cardano.CLI.Read' that became
visible after upstream re-exports widened. Both are separate
cardano-cli cleanups out of scope for this PR.1 parent 9ca9c9b commit 4d4f884
5 files changed
Lines changed: 71 additions & 12 deletions
File tree
- cardano-cli/src/Cardano/CLI
- Compatible/Transaction
- EraBased/Transaction
- Type/Error
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
29 | 52 | | |
30 | 53 | | |
31 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
110 | | - | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
| |||
23 | 33 | | |
24 | 34 | | |
25 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
26 | 58 | | |
27 | 59 | | |
28 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
| 369 | + | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
| |||
1176 | 1178 | | |
1177 | 1179 | | |
1178 | 1180 | | |
1179 | | - | |
| 1181 | + | |
| 1182 | + | |
1180 | 1183 | | |
1181 | 1184 | | |
1182 | 1185 | | |
1183 | | - | |
| 1186 | + | |
1184 | 1187 | | |
1185 | 1188 | | |
1186 | | - | |
| 1189 | + | |
1187 | 1190 | | |
1188 | 1191 | | |
1189 | 1192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
203 | | - | |
204 | 201 | | |
205 | 202 | | |
206 | 203 | | |
| |||
0 commit comments