@typeberry/jam 0.1.1-e48de40 → 0.1.2-3178190
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 +1 -0
- package/block-generator/index.js +34 -15
- package/block-generator/index.js.map +1 -1
- package/importer/index.js +41 -24
- package/importer/index.js.map +1 -1
- package/index.js +43 -26
- package/index.js.map +1 -1
- package/jam-network/index.js +18 -11
- package/jam-network/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/block-generator/index.js
CHANGED
|
@@ -3575,6 +3575,7 @@ var GpVersion;
|
|
|
3575
3575
|
GpVersion["V0_6_7"] = "0.6.7";
|
|
3576
3576
|
GpVersion["V0_7_0"] = "0.7.0";
|
|
3577
3577
|
GpVersion["V0_7_1"] = "0.7.1-preview";
|
|
3578
|
+
GpVersion["V0_7_2"] = "0.7.2-preview";
|
|
3578
3579
|
})(GpVersion || (GpVersion = {}));
|
|
3579
3580
|
var TestSuite;
|
|
3580
3581
|
(function (TestSuite) {
|
|
@@ -3582,7 +3583,7 @@ var TestSuite;
|
|
|
3582
3583
|
TestSuite["JAMDUNA"] = "jamduna";
|
|
3583
3584
|
})(TestSuite || (TestSuite = {}));
|
|
3584
3585
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
3585
|
-
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
3586
|
+
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
|
|
3586
3587
|
const env = typeof process === "undefined" ? {} : process.env;
|
|
3587
3588
|
const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
3588
3589
|
let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
@@ -3591,20 +3592,26 @@ function parseCurrentVersion(env) {
|
|
|
3591
3592
|
if (env === undefined) {
|
|
3592
3593
|
return undefined;
|
|
3593
3594
|
}
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3595
|
+
switch (env) {
|
|
3596
|
+
case GpVersion.V0_6_7:
|
|
3597
|
+
case GpVersion.V0_7_0:
|
|
3598
|
+
case GpVersion.V0_7_1:
|
|
3599
|
+
case GpVersion.V0_7_2:
|
|
3600
|
+
return env;
|
|
3601
|
+
default:
|
|
3602
|
+
throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
|
|
3597
3603
|
}
|
|
3598
|
-
return version;
|
|
3599
3604
|
}
|
|
3600
3605
|
function parseCurrentSuite(env) {
|
|
3601
3606
|
if (env === undefined)
|
|
3602
3607
|
return undefined;
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3608
|
+
switch (env) {
|
|
3609
|
+
case TestSuite.W3F_DAVXY:
|
|
3610
|
+
case TestSuite.JAMDUNA:
|
|
3611
|
+
return env;
|
|
3612
|
+
default:
|
|
3613
|
+
throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
|
|
3606
3614
|
}
|
|
3607
|
-
return val;
|
|
3608
3615
|
}
|
|
3609
3616
|
class Compatibility {
|
|
3610
3617
|
static override(version) {
|
|
@@ -12980,8 +12987,8 @@ function print(level, levelAndName, strings, data) {
|
|
|
12980
12987
|
return;
|
|
12981
12988
|
}
|
|
12982
12989
|
const lvlText = Level[level].padEnd(5);
|
|
12983
|
-
const val = strings.map((v, idx) => `${v}${data[idx]}`);
|
|
12984
|
-
const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
|
|
12990
|
+
const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
|
|
12991
|
+
const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
|
|
12985
12992
|
if (level === Level.WARN) {
|
|
12986
12993
|
console.warn(msg);
|
|
12987
12994
|
}
|
|
@@ -15471,6 +15478,17 @@ class page_range_PageRange {
|
|
|
15471
15478
|
}
|
|
15472
15479
|
return new page_range_PageRange(start, length);
|
|
15473
15480
|
}
|
|
15481
|
+
/** Returns true if the page range is wrapped (`start` >= `end`) and is not empty */
|
|
15482
|
+
isWrapped() {
|
|
15483
|
+
return this.start >= this.end && !this.isEmpty();
|
|
15484
|
+
}
|
|
15485
|
+
/** Checks if given page number is within the range */
|
|
15486
|
+
isInRange(page) {
|
|
15487
|
+
if (this.isWrapped()) {
|
|
15488
|
+
return page >= this.start || page < this.end;
|
|
15489
|
+
}
|
|
15490
|
+
return page >= this.start && page < this.end;
|
|
15491
|
+
}
|
|
15474
15492
|
/** Checks if a range is empty (`length === 0`) */
|
|
15475
15493
|
isEmpty() {
|
|
15476
15494
|
return this.length === 0;
|
|
@@ -15850,10 +15868,11 @@ class memory_builder_MemoryBuilder {
|
|
|
15850
15868
|
startHeapIndex (${startHeapIndex}) has to be less than or equal to endHeapIndex (${endHeapIndex})
|
|
15851
15869
|
`;
|
|
15852
15870
|
this.ensureNotFinalized();
|
|
15853
|
-
const
|
|
15854
|
-
const
|
|
15855
|
-
|
|
15856
|
-
|
|
15871
|
+
const heapRange = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
|
|
15872
|
+
const heapPagesRange = PageRange.fromMemoryRange(heapRange);
|
|
15873
|
+
const initializedPageNumbers = Array.from(this.initialMemory.keys());
|
|
15874
|
+
for (const pageNumber of initializedPageNumbers) {
|
|
15875
|
+
if (heapPagesRange.isInRange(pageNumber)) {
|
|
15857
15876
|
throw new IncorrectSbrkIndex();
|
|
15858
15877
|
}
|
|
15859
15878
|
}
|