@typeberry/convert 0.5.10-6cb1bd5 → 0.5.10-7338c21
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/index.js +17 -16
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5924,6 +5924,7 @@ class descriptor_Descriptor {
|
|
|
5924
5924
|
|
|
5925
5925
|
|
|
5926
5926
|
|
|
5927
|
+
|
|
5927
5928
|
function tryAsExactBytes(a) {
|
|
5928
5929
|
check `${a.isExact} The value is not exact size estimation!`;
|
|
5929
5930
|
return a.bytes;
|
|
@@ -6073,12 +6074,12 @@ class encoder_Encoder {
|
|
|
6073
6074
|
this.offset += 1;
|
|
6074
6075
|
}
|
|
6075
6076
|
/**
|
|
6076
|
-
* Encode a single boolean discriminator using
|
|
6077
|
+
* Encode a single boolean discriminator using 1-byte encoding.
|
|
6077
6078
|
*
|
|
6078
6079
|
* https://graypaper.fluffylabs.dev/#/579bd12/375300375300
|
|
6079
6080
|
*/
|
|
6080
6081
|
bool(bool) {
|
|
6081
|
-
this.
|
|
6082
|
+
this.i8(tryAsU8(bool ? 1 : 0));
|
|
6082
6083
|
}
|
|
6083
6084
|
/**
|
|
6084
6085
|
* Prepare for encoding of a fixed-bytes number.
|
|
@@ -9806,37 +9807,37 @@ const work_package_MAX_NUMBER_OF_WORK_ITEMS = 16;
|
|
|
9806
9807
|
/**
|
|
9807
9808
|
* A piece of work done within a core.
|
|
9808
9809
|
*
|
|
9809
|
-
* `P = (j ∈ Y, h ∈ NS, u ∈ H,
|
|
9810
|
+
* `P = (j ∈ Y, h ∈ NS, u ∈ H, f ∈ Y, x ∈ X, w ∈ ⟦I⟧1∶I)
|
|
9810
9811
|
*
|
|
9811
9812
|
* https://graypaper.fluffylabs.dev/#/579bd12/197000197200
|
|
9812
9813
|
*/
|
|
9813
9814
|
class work_package_WorkPackage extends WithDebug {
|
|
9814
|
-
|
|
9815
|
+
authToken;
|
|
9815
9816
|
authCodeHost;
|
|
9816
9817
|
authCodeHash;
|
|
9817
|
-
|
|
9818
|
+
authConfiguration;
|
|
9818
9819
|
context;
|
|
9819
9820
|
items;
|
|
9820
9821
|
static Codec = codec_codec.Class(work_package_WorkPackage, {
|
|
9821
9822
|
authCodeHost: codec_codec.u32.asOpaque(),
|
|
9822
9823
|
authCodeHash: codec_codec.bytes(hash_HASH_SIZE).asOpaque(),
|
|
9823
9824
|
context: RefineContext.Codec,
|
|
9824
|
-
|
|
9825
|
-
|
|
9825
|
+
authToken: codec_codec.blob,
|
|
9826
|
+
authConfiguration: codec_codec.blob,
|
|
9826
9827
|
items: codec_codec.sequenceVarLen(work_item_WorkItem.Codec).convert((x) => x, (items) => FixedSizeArray.new(items, tryAsWorkItemsCount(items.length))),
|
|
9827
9828
|
});
|
|
9828
|
-
static create({
|
|
9829
|
-
return new work_package_WorkPackage(
|
|
9829
|
+
static create({ authToken, authCodeHost, authCodeHash, authConfiguration, context, items, }) {
|
|
9830
|
+
return new work_package_WorkPackage(authToken, authCodeHost, authCodeHash, authConfiguration, context, items);
|
|
9830
9831
|
}
|
|
9831
9832
|
constructor(
|
|
9832
9833
|
/** `j`: simple blob acting as an authorization token */
|
|
9833
|
-
|
|
9834
|
+
authToken,
|
|
9834
9835
|
/** `h`: index of the service that hosts the authorization code */
|
|
9835
9836
|
authCodeHost,
|
|
9836
9837
|
/** `u`: authorization code hash */
|
|
9837
9838
|
authCodeHash,
|
|
9838
|
-
/** `
|
|
9839
|
-
|
|
9839
|
+
/** `f`: authorization configuration blob */
|
|
9840
|
+
authConfiguration,
|
|
9840
9841
|
/** `x`: context in which the refine function should run */
|
|
9841
9842
|
context,
|
|
9842
9843
|
/**
|
|
@@ -9847,10 +9848,10 @@ class work_package_WorkPackage extends WithDebug {
|
|
|
9847
9848
|
*/
|
|
9848
9849
|
items) {
|
|
9849
9850
|
super();
|
|
9850
|
-
this.
|
|
9851
|
+
this.authToken = authToken;
|
|
9851
9852
|
this.authCodeHost = authCodeHost;
|
|
9852
9853
|
this.authCodeHash = authCodeHash;
|
|
9853
|
-
this.
|
|
9854
|
+
this.authConfiguration = authConfiguration;
|
|
9854
9855
|
this.context = context;
|
|
9855
9856
|
this.items = items;
|
|
9856
9857
|
}
|
|
@@ -16199,10 +16200,10 @@ const workPackageFromJson = json.object({
|
|
|
16199
16200
|
context: refineContextFromJson,
|
|
16200
16201
|
items: json.array(workItemFromJson),
|
|
16201
16202
|
}, ({ authorization, auth_code_host, auth_code_hash, authorizer_config, context, items }) => work_package_WorkPackage.create({
|
|
16202
|
-
authorization,
|
|
16203
|
+
authToken: authorization,
|
|
16203
16204
|
authCodeHost: auth_code_host,
|
|
16204
16205
|
authCodeHash: auth_code_hash,
|
|
16205
|
-
|
|
16206
|
+
authConfiguration: authorizer_config,
|
|
16206
16207
|
context,
|
|
16207
16208
|
items: FixedSizeArray.new(items, tryAsWorkItemsCount(items.length)),
|
|
16208
16209
|
}));
|