Skip to content

Commit 9959647

Browse files
committed
Test transaction chaining
1 parent aeddc1f commit 9959647

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

integration-test/test/test_plutus.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,22 @@ def test_plutus_v2_ref_script(self):
311311
self.chain_context.submit_tx(signed_tx)
312312

313313
self.assert_output(taker_address, take_output)
314+
315+
@retry(tries=TEST_RETRIES, backoff=1.5, delay=6, jitter=(0, 4))
316+
@pytest.mark.post_alonzo
317+
def test_transaction_chaining(self):
318+
giver_address = Address(self.payment_vkey.hash(), network=self.NETWORK)
319+
builder = TransactionBuilder(self.chain_context)
320+
builder.add_input_address(giver_address)
321+
builder.add_output(TransactionOutput(giver_address, 50000000))
322+
tx1 = builder.build_and_sign([self.payment_skey], giver_address)
323+
324+
utxo_to_spend = UTxO(TransactionInput(tx1.id, 0), tx1.transaction_body.outputs[0])
325+
326+
builder = TransactionBuilder(self.chain_context)
327+
builder.add_input(utxo_to_spend)
328+
builder.add_output(TransactionOutput(giver_address, 25000000))
329+
tx2 = builder.build_and_sign([self.payment_skey], giver_address)
330+
331+
self.chain_context.submit_tx(tx1)
332+
self.chain_context.submit_tx(tx2)

0 commit comments

Comments
 (0)