From 873cc9b8f120288635c677b9d7c40be4c3bcd2e1 Mon Sep 17 00:00:00 2001 From: Nerrolol Date: Sat, 1 Jun 2024 21:28:20 +0000 Subject: [PATCH] cast prop ids from felt to uint to enable comparison --- tests/proposals_tests.cairo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/proposals_tests.cairo b/tests/proposals_tests.cairo index 93e1a733..257c6917 100644 --- a/tests/proposals_tests.cairo +++ b/tests/proposals_tests.cairo @@ -172,13 +172,13 @@ fn test_successful_proposal_submission() { let dispatcher = IProposalsDispatcher { contract_address: gov_contract_addr }; start_prank(CheatTarget::One(gov_contract_addr), admin_addr.try_into().unwrap()); - let prop_id_1 = dispatcher.submit_proposal(42, 1); - let prop_id_2 = dispatcher.submit_proposal(43, 1); + let prop_id_1: u128 = dispatcher.submit_proposal(42, 1).try_into().unwrap(); + let prop_id_2: u128 = dispatcher.submit_proposal(43, 1).try_into().unwrap(); assert!(prop_id_1 < prop_id_2, "Proposals should have unique ids"); - let prop_details_1 = dispatcher.get_proposal_details(prop_id_1); - let prop_details_2 = dispatcher.get_proposal_details(prop_id_2); + let prop_details_1 = dispatcher.get_proposal_details(prop_id_1.try_into().unwrap()); + let prop_details_2 = dispatcher.get_proposal_details(prop_id_2.try_into().unwrap()); assert!(prop_details_1.payload == 42, "wrong payload first proposal"); assert!(prop_details_2.payload == 43, "wrong payload second proposal");