Skip to content

Commit

Permalink
feat: update initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlasoin committed Dec 24, 2024
1 parent 6d9fbf2 commit 52d7c62
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/OVMClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ abstract contract OVMClient is IOVMClient, AccessControlEnumerable, Initializabl
/**
* @dev Initializes the contract by setting up the admin role
* @param admin The address that will be granted the admin role
* @param version The version number for this initialization
*/
function initialize(address admin, uint8 version) public reinitializer(version) {
function _OVMClient_initialize(address admin) internal {
_grantRole(ADMIN_ROLE, admin);
}

Expand Down
2 changes: 1 addition & 1 deletion test/OVMClient.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ contract OVMClientTest is Test {
function setUp() public {
mockTasks = new MockOVMGateway();
ovmClient = new OVMClientImpl(address(mockTasks));
ovmClient.initialize(alice, 1);
ovmClient.initialize(alice);
}

function testRequest() public {
Expand Down
2 changes: 1 addition & 1 deletion test/OVMGateway.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract OVMGatewayTest is Test {
// Initialize the OVMGateway contract

ovmClient = new OVMClientImpl(address(tasks));
ovmClient.initialize(_cfg.templateAdmin(), 1);
ovmClient.initialize(_cfg.templateAdmin());
}

function testRequest() public {
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/OVMClientImpl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract OVMClientImpl is OVMClient {
constructor(address OVMGatewayAddress) OVMClient(OVMGatewayAddress) {}

function initialize(address admin) external initializer {
super.initialize(admin, 1);
super._OVMClient_initialize(admin);
}

/**
Expand Down

0 comments on commit 52d7c62

Please sign in to comment.