Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
Signed-off-by: Jawad Tariq <[email protected]>
  • Loading branch information
JDawg287 committed Dec 27, 2023
1 parent f05e679 commit 1c332c4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
14 changes: 7 additions & 7 deletions contracts/topos-core/SubnetRegistrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ contract SubnetRegistrator is Initializable, Ownable {
/// @notice Subnet removal event
event SubnetRemoved(SubnetId subnetId);

/// @notice Contract initializer
/// @dev Can only be called once
/// @param admin address of the admin
function initialize(address admin) public initializer {
_transferOwnership(admin);
}

/// @notice Check if the subnet is already registered
/// @param subnetId FROST public key of a subnet
function subnetExists(SubnetId subnetId) external view returns (bool) {
Expand All @@ -49,13 +56,6 @@ contract SubnetRegistrator is Initializable, Ownable {
return SubnetId.wrap(subnetSet.keyAtIndex(index));
}

/// @notice Contract initializer
/// @dev Can only be called once
/// @param admin address of the admin
function initialize(address admin) public initializer {
_transferOwnership(admin);
}

/// @notice Register a new subnet
/// @param chainId subnet network ID
/// @param currencySymbol currencySymbol for a subnet currency
Expand Down
22 changes: 11 additions & 11 deletions contracts/topos-core/ToposCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ contract ToposCore is IToposCore, AdminMultisigBase, Initializable {
_disableInitializers();
}

/// @notice Contract initializer
/// @dev Can only be called once
/// @param adminAddresses list of admins
/// @param newAdminThreshold number of admins required to approve a call
function initialize(address[] memory adminAddresses, uint256 newAdminThreshold) public initializer {
// NOTE: Admin epoch is incremented to easily invalidate current admin-related state.
uint256 newAdminEpoch = _adminEpoch() + uint256(1);
_setAdminEpoch(newAdminEpoch);
_setAdmins(newAdminEpoch, adminAddresses, newAdminThreshold);
}

/// @notice Sets the subnet ID
/// @param _networkSubnetId The subnet ID of the subnet this contract is to be deployed on
function setNetworkSubnetId(SubnetId _networkSubnetId) external onlyAdmin {
Expand Down Expand Up @@ -125,17 +136,6 @@ contract ToposCore is IToposCore, AdminMultisigBase, Initializable {
}
}

/// @notice Contract initializer
/// @dev Can only be called once
/// @param adminAddresses list of admins
/// @param newAdminThreshold number of admins required to approve a call
function initialize(address[] memory adminAddresses, uint256 newAdminThreshold) public initializer {
// NOTE: Admin epoch is incremented to easily invalidate current admin-related state.
uint256 newAdminEpoch = _adminEpoch() + uint256(1);
_setAdminEpoch(newAdminEpoch);
_setAdmins(newAdminEpoch, adminAddresses, newAdminThreshold);
}

/// @notice Checks if a certificate exists on the ToposCore contract
/// @param certId The Certificate ID
function certificateExists(CertificateId certId) public view returns (bool) {
Expand Down
2 changes: 1 addition & 1 deletion test/topos-core/SubnetRegistrator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Signer, Wallet } from 'ethers'
import { Signer } from 'ethers'
import { ethers } from 'hardhat'
import { expect } from 'chai'

Expand Down
4 changes: 4 additions & 0 deletions test/topos-core/ToposMessaging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ describe('ToposMessaging', () => {

const { proofBlob, receiptsRoot } = await getReceiptMptProof(
sendToken,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ethers.provider as any
)

Expand Down Expand Up @@ -513,6 +514,7 @@ describe('ToposMessaging', () => {

const { proofBlob, receiptsRoot } = await getReceiptMptProof(
sendToken,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ethers.provider as any
)
const certificate = testUtils.encodeCertParam(
Expand Down Expand Up @@ -562,6 +564,7 @@ describe('ToposMessaging', () => {

const { proofBlob, receiptsRoot } = await getReceiptMptProof(
sendToken,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ethers.provider as any
)

Expand Down Expand Up @@ -736,6 +739,7 @@ describe('ToposMessaging', () => {

const { proofBlob, receiptsRoot } = await getReceiptMptProof(
sendToken,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ethers.provider as any
)
return { erc20, proofBlob, receiptsRoot }
Expand Down

0 comments on commit 1c332c4

Please sign in to comment.