From c1af74dca5c075749a1aff1a2bb7e028b11fb2de Mon Sep 17 00:00:00 2001 From: Sebastijan K <58827427+sebastijankuzner@users.noreply.github.com> Date: Mon, 12 Jul 2021 16:24:15 +0200 Subject: [PATCH] chore(core-blockchain): remove updateNetworkStatus on Blockchain (#4402) * chore(core-kernel): remove updateNetworkStatus * chore(core-blockchain): remove updateNetworkStatus * test(core-blockchain): remove updateNetworkStatus --- __tests__/unit/core-blockchain/blockchain.test.ts | 11 ----------- packages/core-blockchain/src/blockchain.ts | 9 --------- .../src/contracts/blockchain/blockchain.ts | 5 ----- 3 files changed, 25 deletions(-) diff --git a/__tests__/unit/core-blockchain/blockchain.test.ts b/__tests__/unit/core-blockchain/blockchain.test.ts index c4e876b0b1..7cbcee1528 100644 --- a/__tests__/unit/core-blockchain/blockchain.test.ts +++ b/__tests__/unit/core-blockchain/blockchain.test.ts @@ -115,7 +115,6 @@ describe("Blockchain", () => { eventDispatcherService.dispatch = jest.fn(); peerNetworkMonitor.cleansePeers = jest.fn(); - peerNetworkMonitor.updateNetworkStatus = jest.fn(); peerNetworkMonitor.broadcastBlock = jest.fn(); peerNetworkMonitor.checkNetworkHealth = jest.fn(); @@ -309,16 +308,6 @@ describe("Blockchain", () => { }); }); - describe("updateNetworkStatus", () => { - it("should call updateNetworkStatus on peerNetworkMonitor", () => { - const blockchain = sandbox.app.resolve(Blockchain); - - blockchain.updateNetworkStatus(); - - expect(peerNetworkMonitor.updateNetworkStatus).toBeCalledTimes(1); - }); - }); - describe("clearAndStopQueue", () => { it("should set state.lastDownloadedBlock from this.getLastBlock() and clear queue", async () => { const blockchain = sandbox.app.resolve(Blockchain); diff --git a/packages/core-blockchain/src/blockchain.ts b/packages/core-blockchain/src/blockchain.ts index 121879bb58..92cdc05323 100644 --- a/packages/core-blockchain/src/blockchain.ts +++ b/packages/core-blockchain/src/blockchain.ts @@ -173,15 +173,6 @@ export class Blockchain implements Contracts.Blockchain.Blockchain { this.setWakeUp(); } - // TODO: Check if required - /** - * Update network status. - * @return {void} - */ - public async updateNetworkStatus(): Promise { - await this.networkMonitor.updateNetworkStatus(); - } - /** * Clear and stop the queue. * @return {void} diff --git a/packages/core-kernel/src/contracts/blockchain/blockchain.ts b/packages/core-kernel/src/contracts/blockchain/blockchain.ts index 61cad865d2..4b4e721db2 100644 --- a/packages/core-kernel/src/contracts/blockchain/blockchain.ts +++ b/packages/core-kernel/src/contracts/blockchain/blockchain.ts @@ -34,11 +34,6 @@ export interface Blockchain { * Reset the wakeup timeout. */ resetWakeUp(): void; - /** - * Update network status. - * @return {void} - */ - updateNetworkStatus(): Promise; /** * Clear and stop the queue.