hardhat 2.9.0-dev.0 → 2.9.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hardhat",
3
- "version": "2.9.0-dev.0",
3
+ "version": "2.9.0-dev.1",
4
4
  "author": "Nomic Labs LLC",
5
5
  "license": "MIT",
6
6
  "homepage": "https://hardhat.org",
@@ -3,6 +3,7 @@ import type WsT from "ws";
3
3
  import debug from "debug";
4
4
  import http, { Server } from "http";
5
5
  import { AddressInfo } from "net";
6
+ import { Client } from "undici";
6
7
 
7
8
  import {
8
9
  EIP1193Provider,
@@ -43,9 +44,20 @@ export class JsonRpcServer implements IJsonRpcServer {
43
44
  }
44
45
 
45
46
  public getProvider = (name = "json-rpc"): EIP1193Provider => {
46
- const { address, port } = this._httpServer.address() as AddressInfo; // TCP sockets return AddressInfo
47
+ const { address, port } = this._httpServer.address() as AddressInfo;
47
48
 
48
- return new HttpProvider(`http://${address}:${port}/`, name);
49
+ const dispatcher = new Client(`http://${address}:${port}/`, {
50
+ keepAliveTimeout: 10,
51
+ keepAliveMaxTimeout: 10,
52
+ });
53
+
54
+ return new HttpProvider(
55
+ `http://${address}:${port}/`,
56
+ name,
57
+ {},
58
+ 20000,
59
+ dispatcher
60
+ );
49
61
  };
50
62
 
51
63
  public listen = (): Promise<{ address: string; port: number }> => {