@acala-network/chopsticks 0.16.0 → 0.16.2

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.
@@ -66,7 +66,7 @@ const respond = (res, data)=>{
66
66
  }
67
67
  res.end();
68
68
  };
69
- const portInUse = async (port)=>{
69
+ const portInUse = async (port, addr)=>{
70
70
  const server = _nodehttp.default.createServer();
71
71
  const inUse = await new Promise((resolve)=>{
72
72
  server.once('error', (e)=>{
@@ -80,7 +80,7 @@ const portInUse = async (port)=>{
80
80
  server.close();
81
81
  resolve(false);
82
82
  });
83
- server.listen(port);
83
+ server.listen(port, addr);
84
84
  });
85
85
  server.removeAllListeners();
86
86
  server.unref();
@@ -153,7 +153,7 @@ const createServer = async (handler, addr, port)=>{
153
153
  }
154
154
  });
155
155
  for(let i = 0; i < 10; i++){
156
- if (port && await portInUse(port + i)) {
156
+ if (port && await portInUse(port + i, addr)) {
157
157
  continue;
158
158
  }
159
159
  const preferPort = port ? port + i : undefined;
@@ -51,7 +51,7 @@ const respond = (res, data)=>{
51
51
  }
52
52
  res.end();
53
53
  };
54
- const portInUse = async (port)=>{
54
+ const portInUse = async (port, addr)=>{
55
55
  const server = http.createServer();
56
56
  const inUse = await new Promise((resolve)=>{
57
57
  server.once('error', (e)=>{
@@ -65,7 +65,7 @@ const portInUse = async (port)=>{
65
65
  server.close();
66
66
  resolve(false);
67
67
  });
68
- server.listen(port);
68
+ server.listen(port, addr);
69
69
  });
70
70
  server.removeAllListeners();
71
71
  server.unref();
@@ -138,7 +138,7 @@ export const createServer = async (handler, addr, port)=>{
138
138
  }
139
139
  });
140
140
  for(let i = 0; i < 10; i++){
141
- if (port && await portInUse(port + i)) {
141
+ if (port && await portInUse(port + i, addr)) {
142
142
  continue;
143
143
  }
144
144
  const preferPort = port ? port + i : undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "bin": "./chopsticks.cjs",
@@ -12,8 +12,8 @@
12
12
  "depcheck": "npx depcheck --ignore-patterns='*.test.ts'"
13
13
  },
14
14
  "dependencies": {
15
- "@acala-network/chopsticks-core": "0.16.0",
16
- "@acala-network/chopsticks-db": "0.16.0",
15
+ "@acala-network/chopsticks-core": "0.16.2",
16
+ "@acala-network/chopsticks-db": "0.16.2",
17
17
  "@pnpm/npm-conf": "^2.2.2",
18
18
  "@polkadot/api": "^12.3.1",
19
19
  "@polkadot/api-augment": "^12.3.1",