Skip to content

Commit 64e1edb

Browse files
committed
cardano-testnet: drop guards from the nested transaction swap sub-transactions
Spending a key-locked input already requires the owner's witness on the sub-transaction, so the --guard-key-hash options added nothing.
1 parent 2a31257 commit 64e1edb

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

‎cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Dijkstra/NestedTransaction.hs‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ import Hedgehog.Internal.Property (MonadTest)
5454
-- Swap (Dijkstra): Alice offers her 100 @TokenA@ for 50 ADA, i.e. 0.5 ADA per token.
5555
--
5656
-- * Alice's sub-transaction spends her token UTxO and pays herself 53 ADA (the 50 ADA
57-
-- price plus the 3 ADA that accompanied the tokens). It is guarded by, and signed
58-
-- with, Alice's key only.
57+
-- price plus the 3 ADA that accompanied the tokens). It is signed with Alice's key
58+
-- only, which spending her input already requires; no guards are needed.
5959
-- * Bob's sub-transaction spends his 60 ADA UTxO and pays himself the 100 @TokenA@
60-
-- (with 3 ADA) plus 7 ADA change, so he pays exactly 50 ADA. It is guarded by, and
61-
-- signed with, Bob's key only.
60+
-- (with 3 ADA) plus 7 ADA change, so he pays exactly 50 ADA. It is signed with Bob's
61+
-- key only.
6262
-- * The batcher's top-level transaction embeds both signed sub-transactions, adds its
6363
-- own input to pay the fee, and is signed by the batcher only.
6464
--
@@ -175,17 +175,13 @@ hprop_nested_transaction_swap = integrationRetryWorkspace 2 "nested-transaction-
175175
bobAdaUtxo <- H.nothingFail $ find (\u -> ueLovelace u == bobFunds && ueTokens u == 0) bobBefore
176176
batcherUtxo <- H.nothingFail $ listToMaybeHead $ sortOn (Down . ueLovelace) batcherBefore
177177

178-
aliceKeyHash <- keyHash execConfig (paymentKeyInfoPair alice)
179-
bobKeyHash <- keyHash execConfig (paymentKeyInfoPair bob)
180-
181178
H.note_ "Alice's sub-transaction: 100 TokenA out, 50 ADA in (0.5 ADA per token)"
182179
aliceSubUnsigned <- H.note $ swapDir </> "alice.sub.unsigned"
183180
aliceSubSigned <- H.note $ swapDir </> "alice.sub.signed"
184181
void $ execCli' execConfig
185182
[ "dijkstra", "transaction", "sub-transaction", "build-raw"
186183
, "--tx-in", ueTxIn aliceTokenUtxo
187184
, "--tx-out", aliceAddr <> "+" <> show @Integer (tokensAda + price)
188-
, "--guard-key-hash", aliceKeyHash
189185
, "--out-file", aliceSubUnsigned
190186
]
191187
void $ execCli' execConfig
@@ -203,7 +199,6 @@ hprop_nested_transaction_swap = integrationRetryWorkspace 2 "nested-transaction-
203199
, "--tx-in", ueTxIn bobAdaUtxo
204200
, "--tx-out", bobAddr <> "+" <> show @Integer tokensAda <> "+" <> tokenA 100
205201
, "--tx-out", bobAddr <> "+" <> show @Integer (bobFunds - price - tokensAda)
206-
, "--guard-key-hash", bobKeyHash
207202
, "--out-file", bobSubUnsigned
208203
]
209204
void $ execCli' execConfig
@@ -299,7 +294,7 @@ utxoEntries policyId assetName = A.withObject "utxo set" $ \o ->
299294
Just policy -> policy A..:? K.fromString assetName A..!= 0
300295
pure UtxoEntry { ueTxIn = K.toString txIn, ueLovelace = lovelace, ueTokens = tokens }
301296

302-
-- | Hash of a payment verification key, as accepted by @--guard-key-hash@.
297+
-- | Hash of a payment verification key, used in the @sig@ minting policy.
303298
keyHash
304299
:: (HasCallStack, MonadTest m, MonadIO m, MonadCatch m)
305300
=> H.ExecConfig

0 commit comments

Comments
 (0)