diff --git a/script/Setup.s.sol b/script/Setup.s.sol index 0fab997..814837d 100644 --- a/script/Setup.s.sol +++ b/script/Setup.s.sol @@ -23,19 +23,15 @@ contract SetupScript is Script { // 1. Setup UserProfile UserProfile userProfileContract = UserProfile(userProfile); - + // Create deployer's profile - userProfileContract.createProfile( - "Deployer", - "A sample deployer bio", - "IPFS://profile-metadata" - ); + userProfileContract.createProfile("Deployer", "A sample deployer bio", "IPFS://profile-metadata"); console2.log("Created profile for deployer:", deployer); // Grant roles bytes32 reputationManagerRole = userProfileContract.REPUTATION_MANAGER_ROLE(); bytes32 verifierRole = userProfileContract.VERIFIER_ROLE(); - + userProfileContract.grantRole(reputationManagerRole, deployer); userProfileContract.grantRole(verifierRole, deployer); console2.log("Granted reputation manager and verifier roles to deployer"); diff --git a/test/UserProfile.t.sol b/test/UserProfile.t.sol index 209b824..046cd52 100644 --- a/test/UserProfile.t.sol +++ b/test/UserProfile.t.sol @@ -235,15 +235,15 @@ contract UserProfileTest is Test { function test_DeployerRoleSetup() public { address deployer = makeAddr("deployer"); vm.startPrank(deployer); - + // Create a new UserProfile contract with deployer as the sender UserProfile newProfile = new UserProfile(); - + // Check that deployer has all roles assertTrue(newProfile.hasRole(newProfile.DEFAULT_ADMIN_ROLE(), deployer)); assertTrue(newProfile.hasRole(newProfile.REPUTATION_MANAGER_ROLE(), deployer)); assertTrue(newProfile.hasRole(newProfile.VERIFIER_ROLE(), deployer)); - + vm.stopPrank(); } @@ -251,7 +251,7 @@ contract UserProfileTest is Test { // Create profile vm.startPrank(user1); userProfile.createProfile("alice", "Web3 developer", "ipfs://metadata1"); - + // Set recovery address address recoveryAddr = makeAddr("recovery"); userProfile.setRecoveryAddress(recoveryAddr); @@ -277,17 +277,17 @@ contract UserProfileTest is Test { userProfile.createProfile("alice", "Web3 developer", "ipfs://metadata1"); vm.startPrank(reputationManager); - + // Test maximum reputation userProfile.updateReputation(user1, 1000); UserProfile.Profile memory profile = userProfile.getProfile(user1); assertEq(profile.reputationScore, 1000); - + // Test minimum reputation userProfile.updateReputation(user1, 0); profile = userProfile.getProfile(user1); assertEq(profile.reputationScore, 0); - + vm.stopPrank(); }