Skip to content

Commit

Permalink
Remove obsolete methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-CZ committed Oct 24, 2024
1 parent 8a062f7 commit 45c78a3
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 35 deletions.
9 changes: 0 additions & 9 deletions contracts/sfc/NodeDriver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 0 additions & 7 deletions contracts/sfc/NodeDriverI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 0 additions & 12 deletions contracts/sfc/SFC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 0 additions & 2 deletions contracts/sfc/SFCI.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions test/NodeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
Expand Down

0 comments on commit 45c78a3

Please sign in to comment.