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
|
@@ -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;
|
|
47
|
+
const { address, port } = this._httpServer.address() as AddressInfo;
|
|
47
48
|
|
|
48
|
-
|
|
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 }> => {
|