cardano_node_tests.tests.tests_plutus_v2 package

Submodules

cardano_node_tests.tests.tests_plutus_v2.mint_build module

cardano_node_tests.tests.tests_plutus_v2.mint_raw module

cardano_node_tests.tests.tests_plutus_v2.mint_raw.check_missing_builtin(cluster_obj: ClusterLib, temp_template: str, payment_addr: AddressRecord, issuer_addr: AddressRecord)[source]

Check builtins added to PlutusV2 from PlutusV3.

cardano_node_tests.tests.tests_plutus_v2.spend_build module

cardano_node_tests.tests.tests_plutus_v2.spend_raw module

cardano_node_tests.tests.tests_plutus_v2.test_mint_build module

Tests for minting with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_mint_build.TestBuildMinting[source]

Bases: object

Tests for minting using Plutus smart contracts and transaction build.

test_inline_datum_visibility(cluster: ClusterLib, payment_addrs: List[AddressRecord], scenario: str)[source]

Test visibility of inline datums on reference inputs by a plutus script.

  • create the necessary Tx outputs

  • mint the token and check that the plutus script have visibility of the inline datum

  • check that the token was minted

  • check that the reference UTxO was not spent

test_minting_ref_missing_txout(cluster: ClusterLib, payment_addrs: List[AddressRecord], plutus_version: str)[source]

Test minting a token with reference Plutus script without providing TxOut for the token.

Uses cardano-cli transaction build command for building the transactions.

  • fund the token issuer and create a UTxO for collateral and reference script

  • check that the expected amount was transferred to token issuer’s address

  • mint the token using a Plutus script

  • check that the token was minted and collateral UTxO was not spent

test_minting_ref_one_token(cluster: ClusterLib, payment_addrs: List[AddressRecord], plutus_version: str)[source]

Test minting a token with reference Plutus script.

Uses cardano-cli transaction build command for building the transactions.

  • fund the token issuer and create a UTxO for collateral and reference script

  • check that the expected amount was transferred to token issuer’s address

  • mint the token using a Plutus script

  • check that the token was minted and collateral UTxO was not spent

  • check expected fees

  • check expected Plutus cost

test_reference_inputs_visibility(cluster: ClusterLib, payment_addrs: List[AddressRecord], valid_redeemer: bool)[source]

Test visibility of reference inputs by a plutus script.

  • create the necessary Tx outputs

  • create the redeemer with the reference input

  • mint the token and check that the plutus script have visibility of the reference input

  • check that the token was minted

  • check that the reference UTxO was not spent

test_reference_scripts_visibility(cluster: ClusterLib, payment_addrs: List[AddressRecord], valid_redeemer: bool)[source]

Test visibility of reference inputs by a plutus script.

  • create needed Tx outputs

  • create the redeemer with the script hash

  • mint the token and check that the plutus script has visibility of the reference script

  • check that the token was minted

  • check that the reference UTxO was not spent

cardano_node_tests.tests.tests_plutus_v2.test_mint_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment address.

cardano_node_tests.tests.tests_plutus_v2.test_mint_negative_build module

Negative tests for minting with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_mint_negative_build.TestNegativeCollateralOutput[source]

Bases: object

Tests for collateral output that are expected to fail.

test_minting_with_unbalanced_total_collateral(cluster: ClusterLib, payment_addrs: List[AddressRecord], with_return_collateral: bool, plutus_version: str)[source]

Test minting a token with a Plutus script with unbalanced total collateral.

Expect failure.

cardano_node_tests.tests.tests_plutus_v2.test_mint_negative_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment address.

cardano_node_tests.tests.tests_plutus_v2.test_mint_negative_raw module

Negative tests for minting with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_mint_negative_raw.TestNegativeCollateralOutput[source]

Bases: object

Tests for collateral output that are expected to fail.

test_minting_with_limited_collateral(cluster: ClusterLib, payment_addrs: List[AddressRecord], plutus_version: str)[source]

Test minting a token with a Plutus script with limited collateral amount.

Expect failure.

  • fund the token issuer and create a UTxO for collateral

  • check that the expected amount was transferred to token issuer’s address

  • mint the token using a Plutus script while limiting the usable collateral amount

  • check that the minting failed because insufficient collateral amount was provided

test_minting_with_unbalanced_total_collateral(cluster: ClusterLib, payment_addrs: List[AddressRecord], with_return_collateral: bool, plutus_version: str)[source]

Test minting a token with a Plutus script with unbalanced total collateral.

Expect failure.

cardano_node_tests.tests.tests_plutus_v2.test_mint_negative_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment address.

cardano_node_tests.tests.tests_plutus_v2.test_mint_raw module

Tests for minting with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_mint_raw.TestMinting[source]

Bases: object

Tests for minting using Plutus smart contracts.

test_datum_hash_visibility(cluster: ClusterLib, payment_addrs: List[AddressRecord], scenario: str)[source]

Test visibility of datum hash on reference inputs by the plutus script.

  • create needed Tx outputs

  • mint token and check that plutus script have visibility of the datum hash

  • check that the token was minted

  • check that the reference UTxO was not spent

test_minting_two_tokens(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_reference_script: bool, plutus_version: str)[source]

Test minting two tokens with a single Plutus script.

  • fund the token issuer and create a UTxO for collateral and possibly reference script

  • check that the expected amount was transferred to token issuer’s address

  • mint the tokens using a Plutus script

  • check that the tokens were minted and collateral UTxO was not spent

test_missing_builtin(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test builtins added to PlutusV2 from PlutusV3.

  • fund the token issuer and create a UTxO for collateral

  • check that the expected amount was transferred to token issuer’s address

  • try to mint the tokens using a Plutus script

  • check that the tokens were minted and collateral UTxO was not spent -OR- check the expected failure

cardano_node_tests.tests.tests_plutus_v2.test_mint_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment address.

cardano_node_tests.tests.tests_plutus_v2.test_mint_secp256k1_build module

SECP256k1 tests for minting with Plutus using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_mint_secp256k1_build.TestSECP256k1[source]

Bases: object

test_negative_secp_builtin_functions(cluster: ClusterLib, payment_addrs: List[AddressRecord], test_vector: str, algorithm: str, plutus_version: str)[source]

Try to mint a token with invalid test vectors.

Expect failure.

test_use_secp_builtin_functions(cluster: ClusterLib, payment_addrs: List[AddressRecord], algorithm: str, plutus_version: str)[source]

Test that is possible to use the two SECP256k1 builtin functions.

  • fund the token issuer

  • mint the tokens using a Plutus script with a SECP256k1 function

  • check that the token was minted

cardano_node_tests.tests.tests_plutus_v2.test_mint_secp256k1_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment address.

cardano_node_tests.tests.tests_plutus_v2.test_mint_secp256k1_raw module

SECP256k1 tests for minting with Plutus using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_mint_secp256k1_raw.TestSECP256k1[source]

Bases: object

test_negative_secp_builtin_functions(cluster: ClusterLib, payment_addrs: List[AddressRecord], test_vector: str, algorithm: str, plutus_version: str)[source]

Try to mint a token with invalid test vectors.

Expect failure.

test_use_secp_builtin_functions(cluster: ClusterLib, payment_addrs: List[AddressRecord], algorithm: str, plutus_version: str)[source]

Test that is possible to use the two SECP256k1 builtin functions.

  • fund the token issuer

  • mint the tokens using a Plutus script with a SECP256k1 function

  • check that the token was minted

cardano_node_tests.tests.tests_plutus_v2.test_mint_secp256k1_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment address.

cardano_node_tests.tests.tests_plutus_v2.test_spend_build module

Tests for spending with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_build.TestBuildLocking[source]

Bases: object

Tests for Tx output locking using Plutus V2 functionalities and transaction build.

test_min_required_utxo(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_inline_datum: bool, use_token: bool, use_reference_script: bool, request: FixtureRequest)[source]

Test minimum required UTxO in different scenarios with v2 functionalities.

  • create the necessary Tx outputs

  • check the min required UTxO

test_txout_locking(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_inline_datum: bool, use_reference_script: bool)[source]

Test combinations of inline datum and datum file + reference script and script file.

  • create the necessary Tx outputs

  • spend the locked UTxO

  • check that the expected UTxOs were correctly spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_collateral_build module

Tests for collateral while spending with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_collateral_build.TestCollateralOutput[source]

Bases: object

Tests for Tx output locking using Plutus with collateral output.

test_collateral_with_tokens(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_return_collateral: bool)[source]

Test failing script using collaterals with tokens.

  • create the token

  • fund the script address and create a UTxO for collateral

  • spend the locked UTxO

  • check that the expected amount of collateral was spent

test_with_total_return_collateral(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_return_collateral: bool, use_total_collateral: bool)[source]

Test failing script with combination of total and return collateral set.

  • fund the script address and create a UTxO for collateral

  • spend the locked UTxO

  • check that the expected amount of collateral was spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_collateral_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_collateral_raw module

Tests for collateral while spending with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_collateral_raw.TestCollateralOutput[source]

Bases: object

Tests for Tx output locking using Plutus with collateral output.

test_collateral_with_tokens(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test failing script using collaterals with tokens.

  • create the token

  • fund the script address and create a UTxO for collateral

  • spend the locked UTxO

  • check that the expected amount of collateral was spent

test_with_total_return_collateral(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_return_collateral: bool, use_total_collateral: bool)[source]

Test failing script with combination of total and return collateral set.

  • fund the script address and create a UTxO for collateral

  • spend the locked UTxO

  • check that the expected amount of collateral was spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_collateral_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_compat_build module

Compatibility tests for spending with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_compat_build.TestCompatibility[source]

Bases: object

Tests for checking compatibility with previous Tx eras.

test_inline_datum_old_tx_era(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an inline datum using old Tx era.

Expect failure with Alonzo-era Tx.

test_reference_script_old_tx_era(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with a reference script using old Tx era.

test_ro_reference_old_tx_era(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test building Tx with read-only reference input using old Tx era.

Expect failure.

cardano_node_tests.tests.tests_plutus_v2.test_spend_compat_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_compat_raw module

Compatibility tests for spending with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_compat_raw.TestCompatibility[source]

Bases: object

Tests for checking compatibility with previous Tx eras.

test_inline_datum_old_tx_era(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an inline datum using old Tx era.

Expect failure with Alonzo-era Tx.

test_reference_script_old_tx_era(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with a reference script using old Tx era.

test_ro_reference_old_tx_era(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test building Tx with read-only reference input using old Tx era.

Expect failure.

cardano_node_tests.tests.tests_plutus_v2.test_spend_compat_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_datum_build module

Tests for datum while spending with Plutus using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_datum_build.TestInlineDatum[source]

Bases: object

Tests for Tx output with inline datum.

test_check_inline_datum_cost(cluster: ClusterLib)[source]

Check that the min UTxO value with an inline datum depends on the size of the datum.

  • calculate the min UTxO value with a small datum, using both inline and hash

  • calculate the min UTxO value with a big datum, using both inline and hash

  • check that the min UTxO value with an inline datum depends on datum size

class cardano_node_tests.tests.tests_plutus_v2.test_spend_datum_build.TestNegativeInlineDatum[source]

Bases: object

Tests for Tx output with inline datum that are expected to fail.

pbt_script_address(cluster: ClusterLib) str[source]

Get Plutus script address.

Meant for property-based tests, so this expensive operation gets executed only once.

test_lock_tx_big_datum(cluster: ClusterLib, payment_addrs: List[AddressRecord], pbt_script_address: str) None[source]

Test locking a Tx output with a datum bigger than the allowed size.

Expect failure on node version < 1.36.0.

test_lock_tx_datum_as_witness(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test unlock a Tx output with a datum as witness.

Expect failure.

test_lock_tx_invalid_datum(cluster: ClusterLib, payment_addrs: List[AddressRecord]) None[source]

Test locking a Tx output with an invalid datum.

Expect failure.

test_lock_tx_v1_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an inline datum and a v1 script.

Expect failure.

cardano_node_tests.tests.tests_plutus_v2.test_spend_datum_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_datum_raw module

Tests for datum while spending with Plutus using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_datum_raw.TestNegativeInlineDatum[source]

Bases: object

Tests for Tx output with inline datum that are expected to fail.

pbt_highest_utxo(cluster: ClusterLib, payment_addrs: List[AddressRecord]) UTXOData[source]

Get UTxO with highest amount of Lovelace.

Meant for property-based tests, so this expensive operation gets executed only once.

pbt_script_address(cluster: ClusterLib) str[source]

Get Plutus script address.

Meant for property-based tests, so this expensive operation gets executed only once.

test_lock_tx_big_datum(cluster: ClusterLib, payment_addrs: List[AddressRecord], pbt_highest_utxo: UTXOData, pbt_script_address: str) None[source]

Test locking a Tx output with a datum bigger than the allowed size.

Expect failure on node version < 1.36.0.

test_lock_tx_datum_as_witness(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test unlock a Tx output with a datum as witness.

Expect failure.

test_lock_tx_invalid_datum(cluster: ClusterLib, payment_addrs: List[AddressRecord]) None[source]

Test locking a Tx output with an invalid datum.

Expect failure.

test_lock_tx_v1_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an inline datum and a v1 script.

Expect failure.

cardano_node_tests.tests.tests_plutus_v2.test_spend_datum_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_raw module

Tests for spending with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_raw.TestLockingV2[source]

Bases: object

Tests for Tx output locking using Plutus V2 smart contracts.

test_datum_bytes_in_dbsync(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test that datum bytes in db-sync corresponds to original datum.

  • create a Tx output with an inline datum at the script address

  • double-check that the UTxO datum hash corresponds to the datum CBOR file

  • check that datum from db-sync produces the original datum hash

  • check that datum bytes in db-sync corresponds to the original datum

test_txout_locking(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_inline_datum: bool, use_reference_script: bool)[source]

Test combinations of inline datum and datum file + reference script and script file.

  • create the necessary Tx outputs

  • check that the expected amount was locked at the script address

  • spend the locked UTxO

  • check that the expected UTxOs were correctly spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_build module

Tests for ro reference inputs while spending with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_build.TestNegativeReadonlyReferenceInputs[source]

Bases: object

Tests for Tx with readonly reference inputs that are expected to fail.

test_reference_input_without_spend_anything(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test using a read-only reference input without spending any UTxO.

Expect failure

test_reference_spent_output(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test use a reference input that was already spent.

Expect failure

test_v1_script_with_reference_input(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test use a reference input with a v1 Plutus script.

Expect failure

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_build.TestReadonlyReferenceInputs[source]

Bases: object

Tests for Tx with readonly reference inputs.

test_reference_input_non_plutus(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test using a read-only reference input in non-Plutus transaction.

  • use a reference input in normal non-Plutus transaction

  • check that the reference input was not spent

  • (optional) check transactions in db-sync

test_same_input_as_reference_input(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test use a reference input that is also a regular input of the same transaction.

  • create the necessary Tx outputs

  • use a reference input that is also a regular input and spend the locked UTxO

  • check that input was spent

  • check “transaction view”

test_use_reference_input(cluster: ClusterLib, payment_addrs: List[AddressRecord], reference_input_scenario: str)[source]

Test use a reference input when unlock some funds.

  • create the necessary Tx outputs

  • use a reference input and spend the locked UTxO

  • check that the reference input was not spent

  • (optional) check transactions in db-sync

test_use_same_reference_input_multiple_times(cluster: ClusterLib, cluster_manager: ClusterManager, payment_addrs: List[AddressRecord])[source]

Test 2 transactions using the same reference input in the same block.

  • create the UTxO that will be used as readonly reference input

  • create the transactions using the same readonly reference input

  • submit both transactions

  • check that the readonly reference input was not spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_raw module

Tests for ro reference inputs while spending with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_raw.TestNegativeReadonlyReferenceInputs[source]

Bases: object

Tests for Tx with readonly reference inputs that are expected to fail.

test_reference_input_without_spend_anything(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test using a read-only reference input without spending any UTxO.

Expect failure

test_reference_spent_output(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test use a reference input that was already spent.

Expect failure

test_v1_script_with_reference_input(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test use a reference input with a v1 Plutus script.

Expect failure

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_raw.TestReadonlyReferenceInputs[source]

Bases: object

Tests for Tx with readonly reference inputs.

test_reference_input_non_plutus(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test using a read-only reference input in non-Plutus transaction.

  • use a reference input in normal non-Plutus transaction

  • check that the reference input was not spent

  • (optional) check transactions in db-sync

test_same_input_as_reference_input(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test use a reference input that is also a regular input of the same transaction.

  • create the necessary Tx outputs

  • use a reference input that is also a regular input and spend the locked UTxO

  • check that the input was spent

  • check “transaction view”

test_use_reference_input(cluster: ClusterLib, payment_addrs: List[AddressRecord], reference_input_scenario: str)[source]

Test use a reference input when unlock some funds.

  • create the necessary Tx outputs

  • use a reference input and spend the locked UTxO

  • check that the reference input was not spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_inputs_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_build module

Tests for reference scripts while spending with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_build.TestNegativeReferenceScripts[source]

Bases: object

Tests for Tx output with reference scripts that are expected to fail.

test_lock_byron_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with a Plutus V2 reference script on Byron address.

Expect failure.

test_lock_tx_v1_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with a Plutus V1 reference script.

Expect failure.

test_not_a_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an invalid reference script.

Expect failure.

test_two_scripts_one_fail(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking two Tx with different Plutus reference scripts in single Tx, one fails.

Expect failure.

test_v1_attached_v2_reference(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an attached V1 script and one using reference V2 script.

  • create the Tx output with an attached V1 script

  • create the Tx output with the reference V2 script

  • spend the locked UTxOs

  • check that the UTxOs were correctly spent

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_build.TestReferenceScripts[source]

Bases: object

Tests for Tx output locking using Plutus smart contracts with reference scripts.

test_mix_reference_attached_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an attached V2 script and one using reference V2 script.

  • create the Tx output with an attached script

  • create the Tx output with the reference script

  • spend the locked UTxOs

  • check that the UTxOs were correctly spent

test_reference_multiple_script(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_same_script: bool)[source]

Test locking two Tx output with a V2 reference script and spending it.

  • create the Tx outputs with an inline datum at the script address

  • create the Tx outputs with the reference scripts

  • spend the locked UTxOs using the reference UTxOs

  • check that the UTxOs were correctly spent

test_reference_same_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking two Tx output with the same V2 reference script and spending it.

  • create the Tx outputs with an inline datum at the script address

  • create the Tx output with the reference script

  • spend the locked UTxOs using the reference UTxO

  • check that the UTxOs were correctly spent

test_spend_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord], plutus_version: str, address_type: str)[source]

Test spending a UTxO that holds a reference script.

  • create a Tx output with reference script (reference script UTxO)

  • check that the expected amount was transferred

  • spend the UTxO

  • check that the UTxO was spent

test_spend_regular_utxo_and_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord], plutus_version: str)[source]

Test spend an UTxO and use a reference a script on the same transaction.

  • create the reference script UTxO with the ‘ALWAYS_FAILS’ script to have confidence that the script was not being executed

  • spend a regular UTxO and reference the script at the same transaction

  • check that the destination UTxO have the right balance

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_raw module

Tests for reference scripts while spending with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_raw.TestNegativeReferenceScripts[source]

Bases: object

Tests for Tx output with reference scripts that are expected to fail.

test_lock_byron_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with a Plutus V2 reference script on Byron address.

Expect failure.

test_lock_tx_v1_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with a Plutus V1 reference script.

Expect failure.

test_not_a_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an invalid reference script.

Expect failure.

test_two_scripts_one_fail(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking two Tx with different Plutus reference scripts in single Tx, one fails.

Expect failure.

test_v1_attached_v2_reference(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an attached V1 script and one using reference V2 script.

Expect failure.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_raw.TestReferenceScripts[source]

Bases: object

Tests for Tx output locking using Plutus smart contracts with reference scripts.

test_mix_reference_attached_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking a Tx output with an attached V2 script and one using reference V2 script.

  • create the Tx output with an attached script

  • create the Tx output with the reference script

  • spend the locked UTxOs

  • check that the UTxOs were correctly spent

test_reference_multiple_script(cluster: ClusterLib, payment_addrs: List[AddressRecord], use_same_script: bool)[source]

Test locking two Tx output with a V2 reference script and spending it.

  • create the Tx outputs with an inline datum at the script address

  • create the Tx outputs with the reference scripts

  • spend the locked UTxOs using the reference UTxOs

  • check that the UTxOs were correctly spent

test_reference_same_script(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test locking two Tx output with the same V2 reference script and spending it.

  • create the Tx outputs with an inline datum at the script address

  • create the Tx output with the reference script

  • spend the locked UTxOs using the reference UTxO

  • check that the UTxOs were correctly spent

test_reference_script_byron_address(cluster: ClusterLib, payment_addrs: List[AddressRecord])[source]

Test creating reference script UTxO on Byron address.

  • create a Byron address

  • create a reference script UTxO on Byron address with the ‘ALWAYS_FAILS’ script to have confidence that the script was not being executed

test_spend_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord], plutus_version: str, address_type: str)[source]

Test spending a UTxO that holds a reference script.

  • create a Tx output with reference script (reference script UTxO)

  • check that the expected amount was transferred

  • spend the UTxO

  • check that the UTxO was spent

test_spend_regular_utxo_and_reference_script(cluster: ClusterLib, payment_addrs: List[AddressRecord], plutus_version: str)[source]

Test spend an UTxO and use a reference a script on the same transaction.

  • create the reference script UTxO with the ‘ALWAYS_FAILS’ script to have confidence that the script was not being executed

  • spend a regular UTxO and reference the script at the same transaction

  • check that the destination UTxO have the right balance

cardano_node_tests.tests.tests_plutus_v2.test_spend_ref_scripts_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_secp256k1_build module

SECP256k1 tests for spending with Plutus V2 using transaction build.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_secp256k1_build.TestSECP256k1[source]

Bases: object

build_fund_script_secp(cluster: ClusterLib, payment_addrs: List[AddressRecord], request: SubRequest) Tuple[str, List[UTXOData], List[UTXOData]][source]

Fund a Plutus script and create the necessary Tx outputs.

test_overspending_execution_budget(cluster: ClusterLib, payment_addrs: List[AddressRecord], build_fund_script_secp: Tuple[str, List[UTXOData], List[UTXOData]]) None[source]

Try to build a transaction with a plutus script that overspend the execution budget.

  • Expect failure.

test_use_secp_builtin_functions(cluster: ClusterLib, payment_addrs: List[AddressRecord], build_fund_script_secp: Tuple[str, List[UTXOData], List[UTXOData]])[source]

Test that it is possible to spend a locked UTxO by a script that uses a SECP function.

  • create the necessary Tx outputs

  • spend the locked UTxO

  • check that script address UTxO was spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_secp256k1_build.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

cardano_node_tests.tests.tests_plutus_v2.test_spend_secp256k1_raw module

SECP256k1 tests for spending with Plutus V2 using transaction build-raw.

class cardano_node_tests.tests.tests_plutus_v2.test_spend_secp256k1_raw.TestSECP256k1[source]

Bases: object

fund_script_secp(cluster: ClusterLib, payment_addrs: List[AddressRecord], request: SubRequest) Tuple[str, List[UTXOData], List[UTXOData]][source]

Fund a Plutus script and create the necessary Tx outputs.

test_use_secp_builtin_functions(cluster: ClusterLib, payment_addrs: List[AddressRecord], fund_script_secp: Tuple[str, List[UTXOData], List[UTXOData]])[source]

Test that it is possible to spend a locked UTxO by a script that uses a SECP function.

  • create the necessary Tx outputs

  • spend the locked UTxO

  • check that script address UTxO was spent

cardano_node_tests.tests.tests_plutus_v2.test_spend_secp256k1_raw.payment_addrs(cluster_manager: ClusterManager, cluster: ClusterLib) List[AddressRecord][source]

Create new payment addresses.

Module contents