Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete methods #79

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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