Skip to content

Commit

Permalink
modify intializer test now that owner stays same
Browse files Browse the repository at this point in the history
removed prank multisig with owner now address(this)
  • Loading branch information
Oba-One committed Aug 20, 2024
1 parent fc7a41d commit 4636e29
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
12 changes: 6 additions & 6 deletions packages/contracts/test/ActionRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract ActionRegistryTest is Test {

function testInitialize() public {
// Test that the contract is properly initialized
assertEq(actionRegistry.owner(), multisig, "Owner should be the multisig address");
assertEq(actionRegistry.owner(), address(this), "Owner should be the multisig address");
}

function testRegisterAction() public {
Expand All @@ -30,7 +30,7 @@ contract ActionRegistryTest is Test {
string[] memory media = new string[](1);
media[0] = "mediaCID1";

vm.prank(multisig);
// vm.prank(multisig);
actionRegistry.registerAction(
block.timestamp,
block.timestamp + 1 days,
Expand All @@ -51,7 +51,7 @@ contract ActionRegistryTest is Test {
// Test updating the start time of an action
testRegisterAction();

vm.prank(multisig);
// vm.prank(multisig);
actionRegistry.updateActionStartTime(0, block.timestamp + 1 hours);

ActionRegistry.Action memory action = actionRegistry.getAction(0);
Expand All @@ -62,7 +62,7 @@ contract ActionRegistryTest is Test {
// Test updating the end time of an action
testRegisterAction();

vm.prank(multisig);
// vm.prank(multisig);
actionRegistry.updateActionEndTime(0, block.timestamp + 2 days);

ActionRegistry.Action memory action = actionRegistry.getAction(0);
Expand All @@ -73,7 +73,7 @@ contract ActionRegistryTest is Test {
// Test updating the instructions of an action
testRegisterAction();

vm.prank(multisig);
// vm.prank(multisig);
actionRegistry.updateActionInstructions(0, "newInstructionsCID");

ActionRegistry.Action memory action = actionRegistry.getAction(0);
Expand All @@ -87,7 +87,7 @@ contract ActionRegistryTest is Test {
string[] memory newMedia = new string[](1);
newMedia[0] = "newMediaCID";

vm.prank(multisig);
// vm.prank(multisig);
actionRegistry.updateActionMedia(0, newMedia);

ActionRegistry.Action memory action = actionRegistry.getAction(0);
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/test/GardenToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ contract GardenTokenTest is Test {

function testInitialize() public {
// Test that the contract is properly initialized
assertEq(gardenToken.owner(), multisig, "Owner should be the multisig address");
assertEq(gardenToken.owner(), owner, "Owner should be the multisig address");
}

// function testMintGarden() public {
Expand Down
11 changes: 6 additions & 5 deletions packages/contracts/test/WorkApprovalResolver.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ contract WorkApprovalResolverTest is Test {
GardenAccount private mockGardenAccount;
MockEAS private mockIEAS;

address private owner = address(this);
address private multisig = address(0x123);
address private attester = address(0x456);
address private recipient = address(0x789);
Expand All @@ -37,13 +38,13 @@ contract WorkApprovalResolverTest is Test {

function testInitialize() public {
// Test that the contract is properly initialized
assertEq(workApprovalResolver.owner(), multisig, "Owner should be the multisig address");
assertEq(workApprovalResolver.owner(), owner, "Owner should be the multisig address");
}

// function testIsPayable() public {
// // Test that the resolver is payable
// assertTrue(workApprovalResolver.isPayable(), "Resolver should be payable");
// }
function testIsPayable() public {
// Test that the resolver is payable
assertTrue(workApprovalResolver.isPayable(), "Resolver should be payable");
}

// function testOnAttestValid() public {
// // Mock a valid action and garden account
Expand Down
13 changes: 7 additions & 6 deletions packages/contracts/test/WorkResolver.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ contract WorkResolverTest is Test {
GardenAccount private mockGardenAccount;
MockEAS private mockIEAS;

address private multisig = address(0x123);
address private attester = address(0x456);
address private recipient = address(0x789);
address private owner = address(this);
address private multisig = address(0x124);
address private attester = address(0x476);
address private recipient = address(0x787);

function setUp() public {
// Deploy the mock contracts
mockActionRegistry = new ActionRegistry();
mockGardenAccount = new GardenAccount(address(0x001), address(0x002), address(0x003), address(0x004));
mockGardenAccount = new GardenAccount(address(0x021), address(0x022), address(0x023), address(0x024));
mockIEAS = new MockEAS();

mockActionRegistry.initialize(multisig);
mockGardenAccount.initialize(address(0x555), "Test Garden", new address[](0), new address[](0));
mockGardenAccount.initialize(address(0x545), "Test Garden", new address[](0), new address[](0));

// Deploy the WorkResolver contract
workResolver = new WorkResolver(address(mockIEAS), address(mockActionRegistry));
Expand All @@ -37,7 +38,7 @@ contract WorkResolverTest is Test {

function testInitialize() public {
// Test that the contract is properly initialized
assertEq(workResolver.owner(), multisig, "Owner should be the multisig address");
assertEq(workResolver.owner(), owner, "Owner should be the multisig address");
}

function testIsPayable() public {
Expand Down

0 comments on commit 4636e29

Please sign in to comment.