@typeberry/convert 0.4.0-5a35a0a → 0.4.0-da92f56
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/README.md +5 -0
- package/index.js +9 -8
- package/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,11 @@ Typeberry is a TypeScript implementation of [JAM protocol](https://graypaper.com
|
|
|
8
8
|
PRs unless the contributor waives any claims to the prize and copy rights for
|
|
9
9
|
the submitted code. By creating the PR you accept this requirement.**
|
|
10
10
|
|
|
11
|
+
## Links
|
|
12
|
+
|
|
13
|
+
- [Documentation](https://fluffylabs.dev/typeberry)
|
|
14
|
+
- [Performance Charts](https://typeberry.fluffylabs.dev)
|
|
15
|
+
|
|
11
16
|
## Implementation status
|
|
12
17
|
|
|
13
18
|
Gray Paper compliance can be controlled via `GP_VERSION` environment variable.
|
package/index.js
CHANGED
|
@@ -4254,7 +4254,11 @@ var TestSuite;
|
|
|
4254
4254
|
})(TestSuite || (TestSuite = {}));
|
|
4255
4255
|
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
|
|
4256
4256
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
4257
|
-
|
|
4257
|
+
/**
|
|
4258
|
+
* Current version is set to track the jam-conformance testing.
|
|
4259
|
+
* Since we are currently at 0.7.1 not 0.7.2, we set our default version accordingly.
|
|
4260
|
+
*/
|
|
4261
|
+
const DEFAULT_VERSION = GpVersion.V0_7_1;
|
|
4258
4262
|
const env = typeof process === "undefined" ? {} : process.env;
|
|
4259
4263
|
let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
4260
4264
|
let CURRENT_SUITE = parseCurrentSuite(env.TEST_SUITE) ?? DEFAULT_SUITE;
|
|
@@ -4313,8 +4317,8 @@ class Compatibility {
|
|
|
4313
4317
|
/**
|
|
4314
4318
|
* Allows selecting different values for different Gray Paper versions from one record.
|
|
4315
4319
|
*
|
|
4316
|
-
*
|
|
4317
|
-
*
|
|
4320
|
+
* fallback The default value to return if no value is found for the current.
|
|
4321
|
+
* versions A record mapping versions to values, checking if the version is greater or equal to the current version.
|
|
4318
4322
|
* @returns The value for the current version, or the default value.
|
|
4319
4323
|
*/
|
|
4320
4324
|
static selectIfGreaterOrEqual({ fallback, versions, }) {
|
|
@@ -4477,7 +4481,7 @@ const workspacePathFix = dev_env.NODE_ENV === "development"
|
|
|
4477
4481
|
|
|
4478
4482
|
;// CONCATENATED MODULE: ./packages/core/utils/opaque.ts
|
|
4479
4483
|
/**
|
|
4480
|
-
*
|
|
4484
|
+
* `Opaque<Type, Token>` constructs a unique type which is a subset of Type with a
|
|
4481
4485
|
* specified unique token Token. It means that base type cannot be assigned to unique type by accident.
|
|
4482
4486
|
* Good examples of opaque types include:
|
|
4483
4487
|
* - JWTs or other tokens - these are special kinds of string used for authorization purposes.
|
|
@@ -10702,7 +10706,7 @@ function parseBootnode(v) {
|
|
|
10702
10706
|
if (name === "" || ip === "" || port === "") {
|
|
10703
10707
|
throw new Error(`Invalid bootnode format, expected: <name>@<ip>:<port>, got: "${v}"`);
|
|
10704
10708
|
}
|
|
10705
|
-
const portNumber = Number.parseInt(port);
|
|
10709
|
+
const portNumber = Number.parseInt(port, 10);
|
|
10706
10710
|
if (!isU16(portNumber)) {
|
|
10707
10711
|
throw new Error(`Invalid port number: "${port}"`);
|
|
10708
10712
|
}
|
|
@@ -14584,7 +14588,6 @@ class LeafNode {
|
|
|
14584
14588
|
/**
|
|
14585
14589
|
* Get the byte length of embedded value.
|
|
14586
14590
|
*
|
|
14587
|
-
* @remark
|
|
14588
14591
|
* Note in case this node only contains hash this is going to be 0.
|
|
14589
14592
|
*/
|
|
14590
14593
|
getValueLength() {
|
|
@@ -14595,7 +14598,6 @@ class LeafNode {
|
|
|
14595
14598
|
/**
|
|
14596
14599
|
* Returns the embedded value.
|
|
14597
14600
|
*
|
|
14598
|
-
* @remark
|
|
14599
14601
|
* Note that this is going to be empty for a regular leaf node (i.e. containing a hash).
|
|
14600
14602
|
*/
|
|
14601
14603
|
getValue() {
|
|
@@ -14605,7 +14607,6 @@ class LeafNode {
|
|
|
14605
14607
|
/**
|
|
14606
14608
|
* Returns contained value hash.
|
|
14607
14609
|
*
|
|
14608
|
-
* @remark
|
|
14609
14610
|
* Note that for embedded value this is going to be full 0-padded 32 bytes.
|
|
14610
14611
|
*/
|
|
14611
14612
|
getValueHash() {
|