Skip to content

Commit 8a96f1d

Browse files
committed
chore: do not send hardhat_setLedgerOutputEnabled over http
1 parent 83721d9 commit 8a96f1d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.changeset/shaggy-bags-work.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"hardhat": patch
3+
---
4+
5+
Do not send `http_setLedgerOutputEnabled` messages if they reacht the HTTP Provider to prevent unwanted warnings in the local hardhat node logs

packages/hardhat-core/src/internal/core/providers/http.ts

+9
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ export class HttpProvider extends EventEmitter implements EIP1193Provider {
8686
}
8787

8888
public async request(args: RequestArguments): Promise<unknown> {
89+
if (args.method === "hardhat_setLedgerOutputEnabled") {
90+
const error = new ProviderError(
91+
"hardhat_setLedgerOutputEnabled - Method not supported",
92+
-32004
93+
);
94+
// eslint-disable-next-line @nomicfoundation/hardhat-internal-rules/only-hardhat-error
95+
throw error;
96+
}
97+
8998
const jsonRpcRequest = this._getJsonRpcRequest(
9099
args.method,
91100
args.params as any[]

0 commit comments

Comments
 (0)