From dbe99af19675d968a9a4f53b4cc0a826701a1340 Mon Sep 17 00:00:00 2001 From: galargh Date: Tue, 6 Aug 2024 13:01:25 +0200 Subject: [PATCH] chore: do not send hardhat_setLedgerOutputEnabled over http --- .../hardhat-core/src/internal/core/providers/http.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/hardhat-core/src/internal/core/providers/http.ts b/packages/hardhat-core/src/internal/core/providers/http.ts index 09add550c59..ee77af137bf 100644 --- a/packages/hardhat-core/src/internal/core/providers/http.ts +++ b/packages/hardhat-core/src/internal/core/providers/http.ts @@ -86,6 +86,15 @@ export class HttpProvider extends EventEmitter implements EIP1193Provider { } public async request(args: RequestArguments): Promise { + if (args.method === "hardhat_setLedgerOutputEnabled") { + const error = new ProviderError( + "hardhat_setLedgerOutputEnabled - Method not supported", + -32004 + ); + // eslint-disable-next-line @nomicfoundation/hardhat-internal-rules/only-hardhat-error + throw error; + } + const jsonRpcRequest = this._getJsonRpcRequest( args.method, args.params as any[]