@@ -1433,40 +1433,54 @@ def test_pparam_keys(
14331433 [r .success () for r in (reqc .cip075 , reqc .cip076 , reqc .cip077 , reqc .cip078 )]
14341434
14351435
1436+ ERA_VALID_PPARAM = {
1437+ # Allowed in Shelley and mary compatible CLI
1438+ "shelley" : ("--max-block-body-size" , 65536 , "maxBlockBodySize" ),
1439+ "mary" : ("--max-block-body-size" , 65536 , "maxBlockBodySize" ),
1440+ # Allowed in Alonzo and babbage compatible CLI
1441+ "alonzo" : ("--max-collateral-inputs" , 4 , "maxCollateralInputs" ),
1442+ "babbage" : ("--max-collateral-inputs" , 4 , "maxCollateralInputs" ),
1443+ }
1444+
1445+
14361446class TestLegacyProposals :
14371447 """Tests for legacy update proposals in Conway."""
14381448
14391449 @allure .link (helpers .get_vcs_link ())
14401450 @submit_utils .PARAM_SUBMIT_METHOD
1451+ @pytest .mark .parametrize ("era" , ["shelley" , "mary" , "alonzo" , "babbage" ])
14411452 @pytest .mark .smoke
14421453 def test_legacy_proposal_submit (
14431454 self ,
14441455 cluster : clusterlib .ClusterLib ,
14451456 payment_addr : clusterlib .AddressRecord ,
14461457 submit_method : str ,
1458+ era : str ,
14471459 ):
1448- """Test that a compatible Babbage pparam proposal cannot be submitted in Conway era ."""
1460+ """Test a compatible-era (Shelley, Mary, Alonzo, Babbage) ."""
14491461 temp_template = common .get_test_id (cluster )
14501462
1463+ arg , val , name = ERA_VALID_PPARAM [era ]
1464+
14511465 update_proposals = [
14521466 clusterlib_utils .UpdateProposal (
1453- arg = "--max-collateral-inputs" ,
1454- value = 4 ,
1455- name = "maxCollateralInputs" ,
1467+ arg = arg ,
1468+ value = val ,
1469+ name = name ,
14561470 ),
14571471 ]
14581472
14591473 cli_args = clusterlib_utils .get_pparams_update_args (update_proposals = update_proposals )
14601474
1461- # NEW: use compatible babbage pparam action
1462- action_file = cluster .g_compatible .babbage .governance .action .gen_pparams_update (
1475+ era_api = getattr (cluster .g_compatible , era )
1476+
1477+ action_file = era_api .governance .action .gen_pparams_update (
14631478 name = temp_template ,
14641479 epoch = cluster .g_query .get_epoch (),
14651480 genesis_vkey_file = cluster .g_genesis .genesis_keys .genesis_vkeys [0 ],
14661481 cli_args = cli_args ,
14671482 )
14681483
1469- # Submitting a Babbage-era proposal in Conway must fail
14701484 with pytest .raises ((clusterlib .CLIError , submit_api .SubmitApiError )) as excinfo :
14711485 clusterlib_utils .build_and_submit_tx (
14721486 cluster_obj = cluster ,
@@ -1483,54 +1497,13 @@ def test_legacy_proposal_submit(
14831497 )
14841498
14851499 err_str = str (excinfo .value )
1486- assert "era" in err_str or "mismatch" in err_str or "TextEnvelope type error" in err_str , (
1487- err_str
1488- )
1489-
1490- @allure .link (helpers .get_vcs_link ())
1491- @pytest .mark .smoke
1492- def test_legacy_proposal_build (
1493- self ,
1494- cluster : clusterlib .ClusterLib ,
1495- ):
1496- """Test building a legacy update proposal with Conway cardano-cli.
1497-
1498- Expect failure as the legacy update proposals are not supported in Conway.
1499- """
1500- temp_template = common .get_test_id (cluster )
1501-
1502- update_proposals = [
1503- clusterlib_utils .UpdateProposal (
1504- arg = "--max-collateral-inputs" ,
1505- value = 4 ,
1506- name = "maxCollateralInputs" ,
1507- ),
1508- ]
15091500
1510- cli_args = clusterlib_utils .get_pparams_update_args (update_proposals = update_proposals )
1511- out_file = f"{ temp_template } _update.proposal"
1501+ print ("\n ERROR MESSAGE START" )
1502+ print (err_str )
1503+ print (" ERROR MESSAGE END\n " )
15121504
1513- with pytest .raises (clusterlib .CLIError ) as excinfo :
1514- cluster .cli (
1515- [
1516- "cardano-cli" ,
1517- "conway" ,
1518- "governance" ,
1519- "create-update-proposal" ,
1520- * cli_args ,
1521- "--out-file" ,
1522- str (out_file ),
1523- "--epoch" ,
1524- str (cluster .g_query .get_epoch ()),
1525- * helpers .prepend_flag (
1526- "--genesis-verification-key-file" ,
1527- cluster .g_genesis .genesis_keys .genesis_vkeys ,
1528- ),
1529- ],
1530- add_default_args = False ,
1531- )
1532- err_str = str (excinfo .value )
1533- assert "Invalid argument `create-update-proposal'" in err_str , err_str
1505+ assert "TextEnvelope type error" in err_str
1506+ assert "UpdateProposalShelley" in err_str
15341507
15351508
15361509class TestNegativeCostModels :
0 commit comments