Skip to content

Commit

Permalink
chore(core-blockchain): remove updateNetworkStatus on Blockchain (#4402)
Browse files Browse the repository at this point in the history
* chore(core-kernel): remove updateNetworkStatus

* chore(core-blockchain): remove updateNetworkStatus

* test(core-blockchain): remove updateNetworkStatus
  • Loading branch information
sebastijankuzner authored Jul 12, 2021
1 parent 14d162d commit c1af74d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
11 changes: 0 additions & 11 deletions __tests__/unit/core-blockchain/blockchain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -309,16 +308,6 @@ describe("Blockchain", () => {
});
});

describe("updateNetworkStatus", () => {
it("should call updateNetworkStatus on peerNetworkMonitor", () => {
const blockchain = sandbox.app.resolve<Blockchain>(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>(Blockchain);
Expand Down
9 changes: 0 additions & 9 deletions packages/core-blockchain/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
await this.networkMonitor.updateNetworkStatus();
}

/**
* Clear and stop the queue.
* @return {void}
Expand Down
5 changes: 0 additions & 5 deletions packages/core-kernel/src/contracts/blockchain/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ export interface Blockchain {
* Reset the wakeup timeout.
*/
resetWakeUp(): void;
/**
* Update network status.
* @return {void}
*/
updateNetworkStatus(): Promise<void>;

/**
* Clear and stop the queue.
Expand Down

0 comments on commit c1af74d

Please sign in to comment.