@acala-network/chopsticks-testing 1.0.2-2 → 1.0.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.
- package/dist/cjs/check.d.ts +2 -2
- package/dist/cjs/check.js +5 -4
- package/dist/esm/check.d.ts +2 -2
- package/dist/esm/check.js +5 -4
- package/package.json +2 -2
package/dist/cjs/check.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiPromise } from '@polkadot/api';
|
|
2
|
-
import { Codec } from '@polkadot/types/types';
|
|
1
|
+
import type { ApiPromise } from '@polkadot/api';
|
|
2
|
+
import type { Codec } from '@polkadot/types/types';
|
|
3
3
|
/**
|
|
4
4
|
* Defines a filter for blockchain events
|
|
5
5
|
* Can be either a string (section name) or an object with method and section
|
package/dist/cjs/check.js
CHANGED
|
@@ -117,7 +117,8 @@ class Checker {
|
|
|
117
117
|
return filters.some((filter)=>{
|
|
118
118
|
if (typeof filter === 'string') {
|
|
119
119
|
return evt.section === filter;
|
|
120
|
-
}
|
|
120
|
+
}
|
|
121
|
+
if ('method' in filter) {
|
|
121
122
|
const { section, method } = filter;
|
|
122
123
|
return evt.section === section && evt.method === method;
|
|
123
124
|
}
|
|
@@ -243,7 +244,7 @@ function redact(value) {
|
|
|
243
244
|
const redactAddress = _class_private_field_get(this, _redactOptions).address === true;
|
|
244
245
|
const processNumber = (value)=>{
|
|
245
246
|
if (precision > 0) {
|
|
246
|
-
const rounded = parseFloat(value.toPrecision(precision));
|
|
247
|
+
const rounded = Number.parseFloat(value.toPrecision(precision));
|
|
247
248
|
if (rounded === value) {
|
|
248
249
|
return rounded;
|
|
249
250
|
}
|
|
@@ -264,7 +265,7 @@ function redact(value) {
|
|
|
264
265
|
if (typeof obj === 'string') {
|
|
265
266
|
if (redactNumber && obj.match(/0x000000[0-9a-f]{26}/)) {
|
|
266
267
|
// this is very likely u128 encoded in hex
|
|
267
|
-
const num = parseInt(obj);
|
|
268
|
+
const num = Number.parseInt(obj);
|
|
268
269
|
return processNumber(num);
|
|
269
270
|
}
|
|
270
271
|
if (redactHash && obj.match(/0x[0-9a-f]{64}/)) {
|
|
@@ -277,7 +278,7 @@ function redact(value) {
|
|
|
277
278
|
return '(address)';
|
|
278
279
|
}
|
|
279
280
|
if (redactNumber && obj.match(/^-?[\d,]+$/)) {
|
|
280
|
-
const num = parseInt(obj.replace(/,/g, ''));
|
|
281
|
+
const num = Number.parseInt(obj.replace(/,/g, ''));
|
|
281
282
|
return processNumber(num);
|
|
282
283
|
}
|
|
283
284
|
return obj;
|
package/dist/esm/check.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiPromise } from '@polkadot/api';
|
|
2
|
-
import { Codec } from '@polkadot/types/types';
|
|
1
|
+
import type { ApiPromise } from '@polkadot/api';
|
|
2
|
+
import type { Codec } from '@polkadot/types/types';
|
|
3
3
|
/**
|
|
4
4
|
* Defines a filter for blockchain events
|
|
5
5
|
* Can be either a string (section name) or an object with method and section
|
package/dist/esm/check.js
CHANGED
|
@@ -67,7 +67,8 @@
|
|
|
67
67
|
return filters.some((filter)=>{
|
|
68
68
|
if (typeof filter === 'string') {
|
|
69
69
|
return evt.section === filter;
|
|
70
|
-
}
|
|
70
|
+
}
|
|
71
|
+
if ('method' in filter) {
|
|
71
72
|
const { section, method } = filter;
|
|
72
73
|
return evt.section === section && evt.method === method;
|
|
73
74
|
}
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
const redactAddress = this.#redactOptions.address === true;
|
|
103
104
|
const processNumber = (value)=>{
|
|
104
105
|
if (precision > 0) {
|
|
105
|
-
const rounded = parseFloat(value.toPrecision(precision));
|
|
106
|
+
const rounded = Number.parseFloat(value.toPrecision(precision));
|
|
106
107
|
if (rounded === value) {
|
|
107
108
|
return rounded;
|
|
108
109
|
}
|
|
@@ -123,7 +124,7 @@
|
|
|
123
124
|
if (typeof obj === 'string') {
|
|
124
125
|
if (redactNumber && obj.match(/0x000000[0-9a-f]{26}/)) {
|
|
125
126
|
// this is very likely u128 encoded in hex
|
|
126
|
-
const num = parseInt(obj);
|
|
127
|
+
const num = Number.parseInt(obj);
|
|
127
128
|
return processNumber(num);
|
|
128
129
|
}
|
|
129
130
|
if (redactHash && obj.match(/0x[0-9a-f]{64}/)) {
|
|
@@ -136,7 +137,7 @@
|
|
|
136
137
|
return '(address)';
|
|
137
138
|
}
|
|
138
139
|
if (redactNumber && obj.match(/^-?[\d,]+$/)) {
|
|
139
|
-
const num = parseInt(obj.replace(/,/g, ''));
|
|
140
|
+
const num = Number.parseInt(obj.replace(/,/g, ''));
|
|
140
141
|
return processNumber(num);
|
|
141
142
|
}
|
|
142
143
|
return obj;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks-testing",
|
|
3
|
-
"version": "1.0.2
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"depcheck": "npx depcheck"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@acala-network/chopsticks-utils": "1.0.2
|
|
16
|
+
"@acala-network/chopsticks-utils": "1.0.2",
|
|
17
17
|
"@polkadot/api": "^15.0",
|
|
18
18
|
"@polkadot/types": "^15.0"
|
|
19
19
|
},
|