Skip to content

Commit

Permalink
4844 tests to dedicated contract: testCannotRegisterIdentitiesIfNotVi…
Browse files Browse the repository at this point in the history
…aProxy
  • Loading branch information
wzmuda committed Aug 22, 2024
1 parent 6128e2f commit 198d00c
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,4 +621,30 @@ contract WorldIDIdentityManagerIdentityRegistration4844 is WorldIDIdentityManage
// Test
assertCallSucceedsOn(identityManagerAddress, callData, new bytes(0));
}

/// @notice Tests that identities can only be registered through the proxy.
function testCannotRegisterIdentitiesIfNotViaProxy() public {
// Setup
address expectedOwner = managerImplV3.owner();
vm.expectRevert("Function must be called through delegatecall");
vm.prank(expectedOwner);

// Test
ManagerImplV3.RegisterIdentities4844Params memory params = ManagerImplV3.RegisterIdentities4844Params({
insertionProof: insertionProof,
commitments: commitments,
commitmentPok: commitmentsPok,
kzgCommitment: kzgCommitment,
kzgProof: kzgProof,
expectedEvaluation: insertionExpectedEvaluation,
preRoot: initialRoot,
postRoot: insertionPostRoot,
kzgChallenge: kzgChallenge,
inputHash: insertionInputHash4844,
batchSize: uint32(identityCommitments.length),
startIndex: startIndex
});

managerImplV3.registerIdentities(params);
}
}

0 comments on commit 198d00c

Please sign in to comment.