From 4470cc38c9ce08aa98b53e7fe8a3a1371e05c437 Mon Sep 17 00:00:00 2001 From: Gabriel Rocheleau Date: Mon, 12 Aug 2024 12:56:42 -0400 Subject: [PATCH] monorepo: type cleanup (#3580) --- packages/blockchain/src/consensus/ethash.ts | 2 +- packages/client/src/rpc/modules/admin.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/blockchain/src/consensus/ethash.ts b/packages/blockchain/src/consensus/ethash.ts index 315c37e798..5b93014c19 100644 --- a/packages/blockchain/src/consensus/ethash.ts +++ b/packages/blockchain/src/consensus/ethash.ts @@ -46,7 +46,7 @@ export class EthashConsensus implements Consensus { public async genesisInit(): Promise {} public async setup({ blockchain }: ConsensusOptions): Promise { this.blockchain = blockchain - this._ethash.cacheDB = this.blockchain!.db as any + this._ethash.cacheDB = this.blockchain.db } public async newBlock(): Promise {} } diff --git a/packages/client/src/rpc/modules/admin.ts b/packages/client/src/rpc/modules/admin.ts index 5b94d3b658..589665af2c 100644 --- a/packages/client/src/rpc/modules/admin.ts +++ b/packages/client/src/rpc/modules/admin.ts @@ -81,8 +81,7 @@ export class Admin { return peers?.map((peer) => { return { id: peer.id, - // Typescript complains about the typing of `_hello` if we make rlpxPeer possibly null - name: (peer.rlpxPeer as any)['_hello'].clientId ?? null, + name: peer.rlpxPeer?.['_hello']?.clientId ?? null, protocols: { eth: { head: peer.eth?.updatedBestHeader