@@ -142,9 +142,7 @@ prop_make_transaction_body_autobalance_multi_asset_collateral = H.propertyOnce $
142
142
let ceo = ConwayEraOnwardsConway
143
143
beo = convert ceo
144
144
sbe = convert beo
145
- meo = convert beo
146
- era = toCardanoEra sbe
147
- aeo <- H. nothingFail $ forEraMaybeEon @ AlonzoEraOnwards era
145
+ -- meo = convert beo
148
146
149
147
systemStart <-
150
148
fmap SystemStart . H. evalIO $
@@ -156,28 +154,26 @@ prop_make_transaction_body_autobalance_multi_asset_collateral = H.propertyOnce $
156
154
LedgerProtocolParameters
157
155
<$> H. readJsonFileOk " test/cardano-api-test/files/input/protocol-parameters/conway.json"
158
156
159
- (sh@ (ScriptHash scriptHash), plutusWitness) <- loadPlutusWitness ceo
160
- let policyId' = PolicyId sh
161
- -- one UTXO with an asset - the same we're minting in the transaction
157
+ (_sh@ (ScriptHash scriptHash), plutusWitness) <- loadPlutusWitness ceo
158
+
159
+ PlutusScriptWitness slang psv psori NoScriptDatumForMint rdmr exunits <- pure plutusWitness
160
+ -- plutus minting script rewritten for spending
161
+ let pw2 = PlutusScriptWitness slang psv psori (ScriptDatumForTxIn Nothing ) rdmr exunits
162
+
162
163
let utxos = mkUtxos beo scriptHash
163
- txInputs = map (, BuildTxWith ( KeyWitness KeyWitnessForSpending )) . toList . M. keys . unUTxO $ utxos
164
- txInputsCollateral = TxInsCollateral aeo $ toList . M. keys . unUTxO $ utxos
164
+ txInputs =
165
+ map (, BuildTxWith ( ScriptWitness ScriptWitnessForSpending pw2)) . toList . M. keys . unUTxO $ utxos
165
166
let address = mkAddress sbe scriptHash
166
- let txMint =
167
- TxMintValue
168
- meo
169
- [(policyId', [(" eeee" , 1 , BuildTxWith plutusWitness)])]
170
167
171
168
let content =
172
169
defaultTxBodyContent sbe
173
170
& setTxIns txInputs
174
- & setTxInsCollateral txInputsCollateral
171
+ & setTxInsReference ( TxInsReference beo ( map fst txInputs))
175
172
& setTxOuts (mkTxOutput beo address Nothing )
176
- & setTxMintValue txMint
177
173
& setTxProtocolParams (pure $ pure pparams)
178
174
179
175
-- autobalanced body has assets and ADA in the change txout
180
- (BalancedTxBody balancedContent _ _ fee ) <-
176
+ (BalancedTxBody _balancedContent _ _ _fee ) <-
181
177
H. leftFail $
182
178
makeTransactionBodyAutoBalance
183
179
sbe
@@ -192,11 +188,12 @@ prop_make_transaction_body_autobalance_multi_asset_collateral = H.propertyOnce $
192
188
address
193
189
Nothing
194
190
195
- 335_475 === fee
196
- TxReturnCollateral _ (TxOut _ txOutValue _ _) <- H. noteShow $ txReturnCollateral balancedContent
197
- let assets = [a | a@ (AssetId _ _, _) <- toList $ txOutValueToValue txOutValue]
198
- H. note_ " Check that all assets from UTXO, from the collateral txin, are in the return collateral."
199
- [(AssetId policyId' " eeee" , 1 )] === assets
191
+ -- 335_475 === fee
192
+ -- TxReturnCollateral _ (TxOut _ txOutValue _ _) <- H.noteShow $ txReturnCollateral balancedContent
193
+ -- let assets = [a | a@(AssetId _ _, _) <- toList $ txOutValueToValue txOutValue]
194
+ -- H.note_ "Check that all assets from UTXO, from the collateral txin, are in the return collateral."
195
+ -- [(AssetId policyId' "eeee", 1)] === assets
196
+ H. failure
200
197
201
198
-- | Implements collateral validation from Babbage spec, from
202
199
-- https://github.com/IntersectMBO/cardano-ledger/releases, babbage-ledger.pdf, Figure 2.
0 commit comments