From 45c78a3373fa04e8dca9184da446d401029605f7 Mon Sep 17 00:00:00 2001 From: Mike-CZ Date: Thu, 24 Oct 2024 12:10:47 +0200 Subject: [PATCH] Remove obsolete methods --- contracts/sfc/NodeDriver.sol | 9 --------- contracts/sfc/NodeDriverI.sol | 7 ------- contracts/sfc/SFC.sol | 12 ------------ contracts/sfc/SFCI.sol | 2 -- test/NodeDriver.ts | 6 +----- 5 files changed, 1 insertion(+), 35 deletions(-) diff --git a/contracts/sfc/NodeDriver.sol b/contracts/sfc/NodeDriver.sol index c58e44c..58a6220 100644 --- a/contracts/sfc/NodeDriver.sol +++ b/contracts/sfc/NodeDriver.sol @@ -143,15 +143,6 @@ contract NodeDriver is Initializable { } function sealEpoch( - uint256[] calldata offlineTimes, - uint256[] calldata offlineBlocks, - uint256[] calldata uptimes, - uint256[] calldata originatedTxsFee - ) external onlyNode { - backend.sealEpoch(offlineTimes, offlineBlocks, uptimes, originatedTxsFee, 841669690); - } - - function sealEpochV1( uint256[] calldata offlineTimes, uint256[] calldata offlineBlocks, uint256[] calldata uptimes, diff --git a/contracts/sfc/NodeDriverI.sol b/contracts/sfc/NodeDriverI.sol index 987eeb1..4fda872 100644 --- a/contracts/sfc/NodeDriverI.sol +++ b/contracts/sfc/NodeDriverI.sol @@ -30,13 +30,6 @@ interface NodeDriverI { function sealEpochValidators(uint256[] calldata nextValidatorIDs) external; function sealEpoch( - uint256[] calldata offlineTimes, - uint256[] calldata offlineBlocks, - uint256[] calldata uptimes, - uint256[] calldata originatedTxsFee - ) external; - - function sealEpochV1( uint256[] calldata offlineTimes, uint256[] calldata offlineBlocks, uint256[] calldata uptimes, diff --git a/contracts/sfc/SFC.sol b/contracts/sfc/SFC.sol index 5a3aa63..6422c7f 100644 --- a/contracts/sfc/SFC.sol +++ b/contracts/sfc/SFC.sol @@ -133,18 +133,6 @@ contract SFC is SFCBase, Version { voteBookAddress = v; } - function migrateValidatorPubkeyUniquenessFlag(uint256 start, uint256 end) external { - for (uint256 vid = start; vid < end; vid++) { - bytes memory pubkey = getValidatorPubkey[vid]; - if (pubkey.length > 0 && pubkeyHashToValidatorID[keccak256(pubkey)] != vid) { - if (pubkeyHashToValidatorID[keccak256(pubkey)] != 0) { - revert PubkeyExists(); - } - pubkeyHashToValidatorID[keccak256(pubkey)] = vid; - } - } - } - function updateValidatorPubkey(bytes calldata pubkey) external { if (pubkey.length != 66 || pubkey[0] != 0xc0) { revert MalformedPubkey(); diff --git a/contracts/sfc/SFCI.sol b/contracts/sfc/SFCI.sol index 205fff2..4574463 100644 --- a/contracts/sfc/SFCI.sol +++ b/contracts/sfc/SFCI.sol @@ -234,8 +234,6 @@ interface SFCI { function updateValidatorPubkey(bytes calldata pubkey) external; - function migrateValidatorPubkeyUniquenessFlag(uint256 start, uint256 end) external; - function setRedirectionAuthorizer(address v) external; function announceRedirection(address to) external; diff --git a/test/NodeDriver.ts b/test/NodeDriver.ts index d71f431..28a8485 100644 --- a/test/NodeDriver.ts +++ b/test/NodeDriver.ts @@ -161,11 +161,7 @@ describe('NodeDriver', () => { describe('Seal epoch', () => { it('Should revert when not node', async function () { - await expect(this.nodeDriver.sealEpoch([0, 1], [0, 1], [0, 1], [0, 1])).to.be.revertedWithCustomError( - this.nodeDriver, - 'NotNode', - ); - await expect(this.nodeDriver.sealEpochV1([0, 1], [0, 1], [0, 1], [0, 1], 0)).to.be.revertedWithCustomError( + await expect(this.nodeDriver.sealEpoch([0, 1], [0, 1], [0, 1], [0, 1], 0)).to.be.revertedWithCustomError( this.nodeDriver, 'NotNode', );