@lodestar/era 1.41.0-dev.ef310100c0 → 1.41.0-dev.f2caa915ab
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/lib/util.d.ts.map +1 -1
- package/lib/util.js +2 -9
- package/lib/util.js.map +1 -1
- package/package.json +7 -7
- package/src/util.ts +2 -12
package/lib/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAEA,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAE9E;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAE/E;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAE/E;AAED,qCAAqC;AACrC,wBAAgB,gBAAgB,CAAC,cAAc,EAAE,UAAU,GAAG,UAAU,CAEvE;AAED,yCAAyC;AACzC,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAM1E"}
|
package/lib/util.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SnappyFramesUncompress, encodeSnappy } from "@lodestar/reqresp/utils";
|
|
1
|
+
import { decodeSnappyFrames, encodeSnappy } from "@lodestar/reqresp/utils";
|
|
3
2
|
/** Read 48-bit signed integer (little-endian) at offset. */
|
|
4
3
|
export function readInt48(bytes, offset) {
|
|
5
4
|
return Buffer.prototype.readIntLE.call(bytes, offset, 6);
|
|
@@ -30,13 +29,7 @@ export function writeUint32(target, offset, v) {
|
|
|
30
29
|
}
|
|
31
30
|
/** Decompress snappy-framed data */
|
|
32
31
|
export function snappyUncompress(compressedData) {
|
|
33
|
-
|
|
34
|
-
const input = new Uint8ArrayList(compressedData);
|
|
35
|
-
const result = decompressor.uncompress(input);
|
|
36
|
-
if (result === null) {
|
|
37
|
-
throw new Error("Snappy decompression failed - no data returned");
|
|
38
|
-
}
|
|
39
|
-
return result.subarray();
|
|
32
|
+
return decodeSnappyFrames(compressedData).subarray();
|
|
40
33
|
}
|
|
41
34
|
/** Compress data using snappy framing */
|
|
42
35
|
export async function snappyCompress(data) {
|
package/lib/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAEzE,4DAA4D;AAC5D,MAAM,UAAU,SAAS,CAAC,KAAiB,EAAE,MAAc;IACzD,OAAO,MAAM,CAAC,SAAS,CAAC,SAAS,C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cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;AACvD,CAAC;AAED,yCAAyC;AACzC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAgB;IACnD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACnG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.41.0-dev.
|
|
14
|
+
"version": "1.41.0-dev.f2caa915ab",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@chainsafe/blst": "^2.2.0",
|
|
43
|
-
"@lodestar/config": "^1.41.0-dev.
|
|
44
|
-
"@lodestar/params": "^1.41.0-dev.
|
|
45
|
-
"@lodestar/reqresp": "^1.41.0-dev.
|
|
46
|
-
"@lodestar/types": "^1.41.0-dev.
|
|
47
|
-
"@lodestar/utils": "^1.41.0-dev.
|
|
43
|
+
"@lodestar/config": "^1.41.0-dev.f2caa915ab",
|
|
44
|
+
"@lodestar/params": "^1.41.0-dev.f2caa915ab",
|
|
45
|
+
"@lodestar/reqresp": "^1.41.0-dev.f2caa915ab",
|
|
46
|
+
"@lodestar/types": "^1.41.0-dev.f2caa915ab",
|
|
47
|
+
"@lodestar/utils": "^1.41.0-dev.f2caa915ab",
|
|
48
48
|
"uint8arraylist": "^2.4.7"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "68d33fac21da9c1aa57fe7c24f9721b14ed96761"
|
|
51
51
|
}
|
package/src/util.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {SnappyFramesUncompress, encodeSnappy} from "@lodestar/reqresp/utils";
|
|
1
|
+
import {decodeSnappyFrames, encodeSnappy} from "@lodestar/reqresp/utils";
|
|
3
2
|
|
|
4
3
|
/** Read 48-bit signed integer (little-endian) at offset. */
|
|
5
4
|
export function readInt48(bytes: Uint8Array, offset: number): number {
|
|
@@ -38,16 +37,7 @@ export function writeUint32(target: Uint8Array, offset: number, v: number): void
|
|
|
38
37
|
|
|
39
38
|
/** Decompress snappy-framed data */
|
|
40
39
|
export function snappyUncompress(compressedData: Uint8Array): Uint8Array {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const input = new Uint8ArrayList(compressedData);
|
|
44
|
-
const result = decompressor.uncompress(input);
|
|
45
|
-
|
|
46
|
-
if (result === null) {
|
|
47
|
-
throw new Error("Snappy decompression failed - no data returned");
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return result.subarray();
|
|
40
|
+
return decodeSnappyFrames(compressedData).subarray();
|
|
51
41
|
}
|
|
52
42
|
|
|
53
43
|
/** Compress data using snappy framing */
|