From 018a04572fb8dffde5d7458663b9675a4bdeac78 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 29 Nov 2024 15:14:35 -0800 Subject: [PATCH] fixed failing tests --- test/CommitteeGovernance.t.sol | 8 +++++++- test/ProposalTemplates.t.sol | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/test/CommitteeGovernance.t.sol b/test/CommitteeGovernance.t.sol index 3341e36..53023fd 100644 --- a/test/CommitteeGovernance.t.sol +++ b/test/CommitteeGovernance.t.sol @@ -5,6 +5,7 @@ import "forge-std/Test.sol"; import "../src/CommitteeGovernance.sol"; import "../src/Governance.sol"; import "../src/PlatformToken.sol"; +import "@openzeppelin/contracts/utils/Strings.sol"; contract CommitteeGovernanceTest is Test { CommitteeGovernance public committeeGov; @@ -85,7 +86,12 @@ contract CommitteeGovernanceTest is Test { function testOnlyAdminCanCreateCommittee() public { vm.startPrank(alice); vm.expectRevert( - hex"e2517d3f000000000000000000000000000000000000000000000000000000000000000001733701979d7191ced62c79d6dde6252b95fb4941eed0547f745e7c3a1bab83b3" + abi.encodePacked( + "AccessControl: account ", + Strings.toHexString(alice), + " is missing role ", + Strings.toHexString(uint256(COMMITTEE_ADMIN_ROLE), 32) + ) ); committeeGov.createCommittee("Test Committee", "Test Description", 500); vm.stopPrank(); diff --git a/test/ProposalTemplates.t.sol b/test/ProposalTemplates.t.sol index b0c0956..8e39db9 100644 --- a/test/ProposalTemplates.t.sol +++ b/test/ProposalTemplates.t.sol @@ -3,6 +3,7 @@ pragma solidity ^0.8.13; import "forge-std/Test.sol"; import "../src/ProposalTemplates.sol"; +import "openzeppelin-contracts/contracts/access/AccessControl.sol"; contract ProposalTemplatesTest is Test { ProposalTemplates public templates; @@ -123,7 +124,12 @@ contract ProposalTemplatesTest is Test { vm.startPrank(alice); vm.expectRevert( - hex"e2517d3f000000000000000000000000000000000000000000000000000000000000000160a76a0b70eaebb9f781b27a8b41cd86da9ad7659595aff5cd32f3d522fa85ba" + abi.encodePacked( + "AccessControl: account ", + Strings.toHexString(alice), + " is missing role ", + Strings.toHexString(uint256(TEMPLATE_ADMIN_ROLE), 32) + ) ); templates.createTemplate( "Test Template", "A test template", mockContract, TEST_FUNCTION, paramNames, paramTypes