Skip to content

Commit

Permalink
Merge pull request #1092 from mkoura/fix_plutus_babbage
Browse files Browse the repository at this point in the history
Fix Plutus tests in Babbage era
  • Loading branch information
mkoura committed May 24, 2022
2 parents a48801d + fa656e5 commit 1361c56
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cardano_node_tests/tests/test_plutus_mint_build.py
Expand Up @@ -119,7 +119,7 @@ class TestBuildMinting:
@allure.link(helpers.get_vcs_link())
@pytest.mark.dbsync
@pytest.mark.testnets
def test_minting(
def test_minting_one_token(
self, cluster: clusterlib.ClusterLib, payment_addrs: List[clusterlib.AddressRecord]
):
"""Test minting a token with a Plutus script.
Expand Down Expand Up @@ -283,7 +283,7 @@ def test_time_range_minting(
# Step 2: mint the "qacoin"

slot_step2 = cluster.get_slot_no()
slots_offset = 1_000
slots_offset = 200
timestamp_offset_ms = int(slots_offset * cluster.slot_length + 5) * 1_000

protocol_version = cluster.get_protocol_params()["protocolVersion"]["major"]
Expand Down Expand Up @@ -463,7 +463,7 @@ def test_two_scripts_minting(
slot_step2 = cluster.get_slot_no()

# "time range" qacoin
slots_offset = 1_000
slots_offset = 200
timestamp_offset_ms = int(slots_offset * cluster.slot_length + 5) * 1_000

protocol_version = cluster.get_protocol_params()["protocolVersion"]["major"]
Expand Down
10 changes: 5 additions & 5 deletions cardano_node_tests/tests/test_plutus_mint_raw.py
Expand Up @@ -177,7 +177,7 @@ class TestMinting:
@allure.link(helpers.get_vcs_link())
@pytest.mark.dbsync
@pytest.mark.testnets
def test_minting(
def test_minting_two_tokens(
self,
cluster: clusterlib.ClusterLib,
payment_addrs: List[clusterlib.AddressRecord],
Expand Down Expand Up @@ -258,7 +258,7 @@ def test_minting(
tx_files=tx_files_step2,
fee=minting_cost.fee + fee_txsize,
# ttl is optional in this test
invalid_hereafter=cluster.get_slot_no() + 1_000_000,
invalid_hereafter=cluster.get_slot_no() + 200,
)
tx_signed_step2 = cluster.sign_tx(
tx_body_file=tx_raw_output_step2.out_file,
Expand Down Expand Up @@ -459,7 +459,7 @@ def test_time_range_minting(
# Step 2: mint the "qacoin"

slot_step2 = cluster.get_slot_no()
slots_offset = 10_000_000
slots_offset = 200
timestamp_offset_ms = int(slots_offset * cluster.slot_length + 5) * 1_000

protocol_version = cluster.get_protocol_params()["protocolVersion"]["major"]
Expand Down Expand Up @@ -504,7 +504,7 @@ def test_time_range_minting(
mint=plutus_mint_data,
tx_files=tx_files_step2,
fee=minting_cost.fee + FEE_MINT_TXSIZE,
invalid_before=slot_step2 - 1_000,
invalid_before=slot_step2 - slots_offset,
invalid_hereafter=slot_step2 + slots_offset,
)
tx_signed_step2 = cluster.sign_tx(
Expand Down Expand Up @@ -629,7 +629,7 @@ def test_two_scripts_minting(
slot_step2 = cluster.get_slot_no()

# "time range" qacoin
slots_offset = 1_000
slots_offset = 200
timestamp_offset_ms = int(slots_offset * cluster.slot_length + 5) * 1_000

protocol_version = cluster.get_protocol_params()["protocolVersion"]["major"]
Expand Down
3 changes: 2 additions & 1 deletion cardano_node_tests/tests/test_plutus_spend_raw.py
Expand Up @@ -415,6 +415,7 @@ def _check_pretty_utxo(
.split()
)

tx_era = VERSIONS.transaction_era_name.title()
expected_out = [
"TxHash",
"TxIx",
Expand All @@ -426,7 +427,7 @@ def _check_pretty_utxo(
tx_raw_output.txouts[0].coin,
"+",
"TxOutDatumHash",
"ScriptDataInAlonzoEra",
f"ScriptDataIn{tx_era}Era",
f'"{tx_raw_output.txouts[0].datum_hash}"',
]

Expand Down

0 comments on commit 1361c56

Please sign in to comment.