@typeberry/jam 0.1.2-8c85275 → 0.1.2-953c012
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 +18 -11
- package/block-generator/index.js.map +1 -1
- package/importer/index.js +24 -15
- package/importer/index.js.map +1 -1
- package/index.js +24 -15
- 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/importer/index.js
CHANGED
|
@@ -4245,6 +4245,7 @@ var GpVersion;
|
|
|
4245
4245
|
GpVersion["V0_6_7"] = "0.6.7";
|
|
4246
4246
|
GpVersion["V0_7_0"] = "0.7.0";
|
|
4247
4247
|
GpVersion["V0_7_1"] = "0.7.1-preview";
|
|
4248
|
+
GpVersion["V0_7_2"] = "0.7.2-preview";
|
|
4248
4249
|
})(GpVersion || (GpVersion = {}));
|
|
4249
4250
|
var TestSuite;
|
|
4250
4251
|
(function (TestSuite) {
|
|
@@ -4252,7 +4253,7 @@ var TestSuite;
|
|
|
4252
4253
|
TestSuite["JAMDUNA"] = "jamduna";
|
|
4253
4254
|
})(TestSuite || (TestSuite = {}));
|
|
4254
4255
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
4255
|
-
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
4256
|
+
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
|
|
4256
4257
|
const env = typeof process === "undefined" ? {} : process.env;
|
|
4257
4258
|
const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
4258
4259
|
let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
@@ -4261,20 +4262,26 @@ function parseCurrentVersion(env) {
|
|
|
4261
4262
|
if (env === undefined) {
|
|
4262
4263
|
return undefined;
|
|
4263
4264
|
}
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4265
|
+
switch (env) {
|
|
4266
|
+
case GpVersion.V0_6_7:
|
|
4267
|
+
case GpVersion.V0_7_0:
|
|
4268
|
+
case GpVersion.V0_7_1:
|
|
4269
|
+
case GpVersion.V0_7_2:
|
|
4270
|
+
return env;
|
|
4271
|
+
default:
|
|
4272
|
+
throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
|
|
4267
4273
|
}
|
|
4268
|
-
return version;
|
|
4269
4274
|
}
|
|
4270
4275
|
function parseCurrentSuite(env) {
|
|
4271
4276
|
if (env === undefined)
|
|
4272
4277
|
return undefined;
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4278
|
+
switch (env) {
|
|
4279
|
+
case TestSuite.W3F_DAVXY:
|
|
4280
|
+
case TestSuite.JAMDUNA:
|
|
4281
|
+
return env;
|
|
4282
|
+
default:
|
|
4283
|
+
throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
|
|
4276
4284
|
}
|
|
4277
|
-
return val;
|
|
4278
4285
|
}
|
|
4279
4286
|
class Compatibility {
|
|
4280
4287
|
static override(version) {
|
|
@@ -13406,8 +13413,8 @@ function print(level, levelAndName, strings, data) {
|
|
|
13406
13413
|
return;
|
|
13407
13414
|
}
|
|
13408
13415
|
const lvlText = Level[level].padEnd(5);
|
|
13409
|
-
const val = strings.map((v, idx) => `${v}${data[idx]}`);
|
|
13410
|
-
const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
|
|
13416
|
+
const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
|
|
13417
|
+
const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
|
|
13411
13418
|
if (level === Level.WARN) {
|
|
13412
13419
|
console.warn(msg);
|
|
13413
13420
|
}
|
|
@@ -22769,8 +22776,8 @@ var FetchKind;
|
|
|
22769
22776
|
|
|
22770
22777
|
|
|
22771
22778
|
const info_IN_OUT_REG = 7;
|
|
22772
|
-
const OFFSET_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) ? 9 : 11;
|
|
22773
|
-
const LEN_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) ? 10 : 12;
|
|
22779
|
+
const OFFSET_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) || Compatibility.isGreaterOrEqual(GpVersion.V0_7_2) ? 9 : 11;
|
|
22780
|
+
const LEN_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) || Compatibility.isGreaterOrEqual(GpVersion.V0_7_2) ? 10 : 12;
|
|
22774
22781
|
/**
|
|
22775
22782
|
* Return info about some account.
|
|
22776
22783
|
*
|
|
@@ -22787,7 +22794,7 @@ const LEN_REG = Compatibility.isSuite(TestSuite.W3F_DAVXY) ? 10 : 12;
|
|
|
22787
22794
|
* a = last accumulation timeslot
|
|
22788
22795
|
* p = parent service
|
|
22789
22796
|
*
|
|
22790
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
22797
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/333b00333b00?v=0.7.2
|
|
22791
22798
|
*/
|
|
22792
22799
|
class Info {
|
|
22793
22800
|
currentServiceId;
|
|
@@ -22817,6 +22824,8 @@ class Info {
|
|
|
22817
22824
|
const offset = minU64(regs.get(OFFSET_REG), valueLength);
|
|
22818
22825
|
// l
|
|
22819
22826
|
const length = minU64(regs.get(LEN_REG), numbers_tryAsU64(valueLength - offset));
|
|
22827
|
+
// NOTE: casting to `Number` is safe in both places, since we are always bounded
|
|
22828
|
+
// by the actual `encodedInfo.length`, which is equal `96`.
|
|
22820
22829
|
const chunk = encodedInfo.raw.subarray(Number(offset), Number(offset + length));
|
|
22821
22830
|
const writeResult = memory.storeFrom(outputStart, chunk);
|
|
22822
22831
|
if (writeResult.isError) {
|
|
@@ -22836,7 +22845,7 @@ class Info {
|
|
|
22836
22845
|
*
|
|
22837
22846
|
* Used exclusively by `info` host call.
|
|
22838
22847
|
*
|
|
22839
|
-
* https://graypaper.fluffylabs.dev/#/
|
|
22848
|
+
* https://graypaper.fluffylabs.dev/#/ab2cdbd/33920033b500?v=0.7.2
|
|
22840
22849
|
*/
|
|
22841
22850
|
const codecServiceAccountInfoWithThresholdBalance = descriptors_codec.object({
|
|
22842
22851
|
codeHash: descriptors_codec.bytes(hash_HASH_SIZE),
|