diff --git a/src/vm/tests/costs.rs b/src/vm/tests/costs.rs index 2d9ead2dae..ef9bf6830f 100644 --- a/src/vm/tests/costs.rs +++ b/src/vm/tests/costs.rs @@ -1204,11 +1204,6 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { ]; let bad_proposals = bad_cases.len(); - let voting_contract_to_use: &QualifiedContractIdentifier = if use_mainnet { - &COST_VOTING_MAINNET_CONTRACT - } else { - &COST_VOTING_TESTNET_CONTRACT - }; { let mut store = marf_kv.begin(&StacksBlockId([1 as u8; 32]), &StacksBlockId([2 as u8; 32])); @@ -1217,7 +1212,7 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { db.begin(); db.set_variable_unknown_descriptor( - voting_contract_to_use, + &COST_VOTING_TESTNET_CONTRACT, "confirmed-proposal-count", Value::UInt(bad_proposals as u128), ) @@ -1235,7 +1230,7 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { intercepted_ct, intercepted_f, cost_ct, cost_f ); db.set_entry_unknown_descriptor( - voting_contract_to_use, + &COST_VOTING_TESTNET_CONTRACT, "confirmed-proposals", execute(&format!("{{ confirmed-id: u{} }}", ix)), execute(&value), @@ -1272,7 +1267,7 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { for (target, referenced_function) in tracker.cost_function_references().into_iter() { assert_eq!( &referenced_function.contract_id, - &boot_code_id("costs", use_mainnet), + &boot_code_id("costs", false), "All cost functions should still point to the boot costs" ); assert_eq!( @@ -1315,7 +1310,7 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { let good_proposals = good_cases.len() as u128; db.set_variable_unknown_descriptor( - voting_contract_to_use, + &COST_VOTING_TESTNET_CONTRACT, "confirmed-proposal-count", Value::UInt(bad_proposals as u128 + good_proposals), ) @@ -1333,7 +1328,7 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { intercepted_ct, intercepted_f, cost_ct, cost_f ); db.set_entry_unknown_descriptor( - voting_contract_to_use, + &COST_VOTING_TESTNET_CONTRACT, "confirmed-proposals", execute(&format!("{{ confirmed-id: u{} }}", ix + bad_proposals)), execute(&value), @@ -1365,8 +1360,7 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { let (_db, tracker) = owned_env.destruct().unwrap(); // cost of `le` should be less now, because the proposal made it free - // DO NOT SUBMIT: why does this fail? - // assert!(le_cost_without_interception.exceeds(&tracker.get_total())); + assert!(le_cost_without_interception.exceeds(&tracker.get_total())); let circuits = tracker.contract_call_circuits(); assert_eq!(circuits.len(), 2); @@ -1385,13 +1379,12 @@ fn test_cost_voting_integration(#[case] use_mainnet: bool) { for (target, referenced_function) in tracker.cost_function_references().into_iter() { if target == &ClarityCostFunction::Le { - // DO NOT SUBMIT: uncomment - // assert_eq!(&referenced_function.contract_id, &cost_definer); - // assert_eq!(&referenced_function.function_name, "cost-definition-le"); + assert_eq!(&referenced_function.contract_id, &cost_definer); + assert_eq!(&referenced_function.function_name, "cost-definition-le"); } else { assert_eq!( &referenced_function.contract_id, - &boot_code_id("costs", use_mainnet), + &boot_code_id("costs", false), "Cost function should still point to the boot costs" ); assert_eq!(