Skip to content

Commit

Permalink
chore: do not send hardhat_setLedgerOutputEnabled over http
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Aug 7, 2024
1 parent 83721d9 commit 8a96f1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-bags-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hardhat": patch
---

Do not send `http_setLedgerOutputEnabled` messages if they reacht the HTTP Provider to prevent unwanted warnings in the local hardhat node logs
9 changes: 9 additions & 0 deletions packages/hardhat-core/src/internal/core/providers/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ export class HttpProvider extends EventEmitter implements EIP1193Provider {
}

public async request(args: RequestArguments): Promise<unknown> {
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[]
Expand Down

0 comments on commit 8a96f1d

Please sign in to comment.