@@ -321,7 +321,9 @@ def test_transaction_chaining(self):
321
321
builder .add_output (TransactionOutput (giver_address , 50000000 ))
322
322
tx1 = builder .build_and_sign ([self .payment_skey ], giver_address )
323
323
324
- utxo_to_spend = UTxO (TransactionInput (tx1 .id , 0 ), tx1 .transaction_body .outputs [0 ])
324
+ utxo_to_spend = UTxO (
325
+ TransactionInput (tx1 .id , 0 ), tx1 .transaction_body .outputs [0 ]
326
+ )
325
327
326
328
builder = TransactionBuilder (self .chain_context )
327
329
builder .add_input (utxo_to_spend )
@@ -330,3 +332,42 @@ def test_transaction_chaining(self):
330
332
331
333
self .chain_context .submit_tx (tx1 )
332
334
self .chain_context .submit_tx (tx2 )
335
+
336
+ @retry (tries = TEST_RETRIES , backoff = 1.5 , delay = 6 , jitter = (0 , 4 ))
337
+ @pytest .mark .post_alonzo
338
+ def test_get_plutus_script (self ):
339
+ # ----------- Giver give ---------------
340
+ with open ("./plutus_scripts/fortytwoV2.plutus" , "r" ) as f :
341
+ script_hex = f .read ()
342
+ forty_two_script = PlutusV2Script (cbor2 .loads (bytes .fromhex (script_hex )))
343
+
344
+ script_hash = plutus_script_hash (forty_two_script )
345
+
346
+ script_address = Address (script_hash , network = self .NETWORK )
347
+
348
+ giver_address = Address (self .payment_vkey .hash (), network = self .NETWORK )
349
+
350
+ builder = TransactionBuilder (self .chain_context )
351
+ builder .add_input_address (giver_address )
352
+ builder .add_output (
353
+ TransactionOutput (script_address , 50000000 , script = forty_two_script )
354
+ )
355
+
356
+ signed_tx = builder .build_and_sign ([self .payment_skey ], giver_address )
357
+
358
+ print ("############### Transaction created ###############" )
359
+ print (signed_tx )
360
+ print (signed_tx .to_cbor_hex ())
361
+ print ("############### Submitting transaction ###############" )
362
+ self .chain_context .submit_tx (signed_tx )
363
+ time .sleep (3 )
364
+
365
+ utxos = self .chain_context .utxos (script_address )
366
+
367
+ assert utxos [0 ].output .script == forty_two_script
368
+
369
+
370
+ class TestPlutusOgmiosOnly (TestPlutus ):
371
+ @classmethod
372
+ def setup_class (cls ):
373
+ cls .chain_context ._kupo_url = None
0 commit comments