@typeberry/lib 0.5.10-ca4935b → 0.5.10-ec38e0b
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/package.json +1 -1
- package/packages/jam/block/work-package.d.ts +7 -7
- package/packages/jam/block/work-package.d.ts.map +1 -1
- package/packages/jam/block/work-package.js +12 -12
- package/packages/jam/executor/pvm-executor.d.ts +7 -0
- package/packages/jam/executor/pvm-executor.d.ts.map +1 -1
- package/packages/jam/executor/pvm-executor.js +15 -0
- package/packages/jam/in-core/externalities/refine.d.ts +2 -2
- package/packages/jam/in-core/externalities/refine.d.ts.map +1 -1
- package/packages/jam/in-core/externalities/refine.js +10 -3
- package/packages/jam/in-core/externalities/refine.test.js +53 -0
- package/packages/jam/in-core/in-core.d.ts +7 -22
- package/packages/jam/in-core/in-core.d.ts.map +1 -1
- package/packages/jam/in-core/in-core.js +16 -184
- package/packages/jam/in-core/in-core.test.js +47 -15
- package/packages/jam/in-core/is-authorized.d.ts +33 -0
- package/packages/jam/in-core/is-authorized.d.ts.map +1 -0
- package/packages/jam/in-core/is-authorized.js +72 -0
- package/packages/jam/in-core/is-authorized.test.d.ts +2 -0
- package/packages/jam/in-core/is-authorized.test.d.ts.map +1 -0
- package/packages/jam/in-core/is-authorized.test.js +125 -0
- package/packages/jam/in-core/refine.d.ts +34 -0
- package/packages/jam/in-core/refine.d.ts.map +1 -0
- package/packages/jam/in-core/refine.js +176 -0
- package/packages/jam/in-core/refine.test.d.ts +2 -0
- package/packages/jam/in-core/refine.test.d.ts.map +1 -0
- package/packages/jam/in-core/refine.test.js +6 -0
- package/packages/jam/jam-host-calls/accumulate/bless.js +9 -9
- package/packages/jam/jam-host-calls/externalities/partial-state.d.ts +1 -1
- package/packages/jam/jam-host-calls/externalities/refine-externalities.d.ts +1 -1
- package/packages/jam/jam-host-calls/externalities/refine-externalities.d.ts.map +1 -1
- package/packages/jam/jam-host-calls/general/fetch.d.ts +40 -40
- package/packages/jam/jam-host-calls/general/fetch.d.ts.map +1 -1
- package/packages/jam/jam-host-calls/general/fetch.js +30 -30
- package/packages/jam/jam-host-calls/general/fetch.test.js +17 -14
- package/packages/jam/jamnp-s/protocol/ce-133-work-package-submission.d.ts +2 -2
- package/packages/jam/transition/accumulate/accumulation-result-merge-utils.js +48 -39
- package/packages/jam/transition/externalities/accumulate-externalities.d.ts +2 -2
- package/packages/jam/transition/externalities/accumulate-externalities.d.ts.map +1 -1
- package/packages/jam/transition/externalities/accumulate-externalities.js +20 -7
- package/packages/jam/transition/externalities/accumulate-externalities.test.js +74 -4
- package/packages/jam/transition/externalities/index.d.ts +1 -0
- package/packages/jam/transition/externalities/index.d.ts.map +1 -1
- package/packages/jam/transition/externalities/index.js +1 -0
- package/packages/jam/transition/externalities/is-authorized-fetch-externalities.d.ts +22 -0
- package/packages/jam/transition/externalities/is-authorized-fetch-externalities.d.ts.map +1 -0
- package/packages/jam/transition/externalities/is-authorized-fetch-externalities.js +41 -0
- package/packages/jam/transition/externalities/refine-fetch-externalities.d.ts +7 -7
- package/packages/jam/transition/externalities/refine-fetch-externalities.d.ts.map +1 -1
- package/packages/jam/transition/externalities/refine-fetch-externalities.js +17 -9
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BytesBlob } from "#@typeberry/bytes";
|
|
2
|
+
import { general } from "#@typeberry/jam-host-calls";
|
|
3
|
+
import { getEncodedConstants } from "./fetch-externalities.js";
|
|
4
|
+
export class IsAuthorizedFetchExternalities {
|
|
5
|
+
chainSpec;
|
|
6
|
+
params;
|
|
7
|
+
context = general.FetchContext.IsAuthorized;
|
|
8
|
+
constructor(chainSpec, params) {
|
|
9
|
+
this.chainSpec = chainSpec;
|
|
10
|
+
this.params = params;
|
|
11
|
+
}
|
|
12
|
+
constants() {
|
|
13
|
+
return getEncodedConstants(this.chainSpec);
|
|
14
|
+
}
|
|
15
|
+
// TODO [ToDr] Return encoded work package E(p)
|
|
16
|
+
workPackage() {
|
|
17
|
+
return BytesBlob.empty();
|
|
18
|
+
}
|
|
19
|
+
authConfiguration() {
|
|
20
|
+
return this.params.authConfiguration;
|
|
21
|
+
}
|
|
22
|
+
authToken() {
|
|
23
|
+
return this.params.authToken;
|
|
24
|
+
}
|
|
25
|
+
// TODO [ToDr] Return encoded refinement context
|
|
26
|
+
refineContext() {
|
|
27
|
+
return BytesBlob.empty();
|
|
28
|
+
}
|
|
29
|
+
// TODO [ToDr] Return encoded work items
|
|
30
|
+
allWorkItems() {
|
|
31
|
+
return BytesBlob.empty();
|
|
32
|
+
}
|
|
33
|
+
// TODO [ToDr] Return single work item summary
|
|
34
|
+
oneWorkItem(_workItem) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// TODO [ToDr] Return work item payload
|
|
38
|
+
workItemPayload(_workItem) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntropyHash } from "#@typeberry/block";
|
|
2
|
-
import {
|
|
2
|
+
import { BytesBlob } from "#@typeberry/bytes";
|
|
3
3
|
import type { ChainSpec } from "#@typeberry/config";
|
|
4
4
|
import { general } from "#@typeberry/jam-host-calls";
|
|
5
5
|
import type { U64 } from "#@typeberry/numbers";
|
|
@@ -9,14 +9,14 @@ export declare class RefineFetchExternalities implements general.IRefineFetch {
|
|
|
9
9
|
constructor(chainSpec: ChainSpec);
|
|
10
10
|
constants(): BytesBlob;
|
|
11
11
|
entropy(): EntropyHash;
|
|
12
|
-
authorizerTrace(): BytesBlob
|
|
12
|
+
authorizerTrace(): BytesBlob;
|
|
13
13
|
workItemExtrinsic(_workItem: U64 | null, _index: U64): BytesBlob | null;
|
|
14
14
|
workItemImport(_workItem: U64 | null, _index: U64): BytesBlob | null;
|
|
15
|
-
workPackage(): BytesBlob
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
refineContext(): BytesBlob
|
|
19
|
-
allWorkItems(): BytesBlob
|
|
15
|
+
workPackage(): BytesBlob;
|
|
16
|
+
authConfiguration(): BytesBlob;
|
|
17
|
+
authToken(): BytesBlob;
|
|
18
|
+
refineContext(): BytesBlob;
|
|
19
|
+
allWorkItems(): BytesBlob;
|
|
20
20
|
oneWorkItem(_workItem: U64): BytesBlob | null;
|
|
21
21
|
workItemPayload(_workItem: U64): BytesBlob | null;
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refine-fetch-externalities.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/transition/externalities/refine-fetch-externalities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAS,
|
|
1
|
+
{"version":3,"file":"refine-fetch-externalities.d.ts","sourceRoot":"","sources":["../../../../../../packages/jam/transition/externalities/refine-fetch-externalities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAS,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAG9C,qBAAa,wBAAyB,YAAW,OAAO,CAAC,YAAY;IAGvD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAFtC,QAAQ,CAAC,OAAO,+BAA+B;gBAElB,SAAS,EAAE,SAAS;IAEjD,SAAS,IAAI,SAAS;IAKtB,OAAO,IAAI,WAAW;IAKtB,eAAe,IAAI,SAAS;IAK5B,iBAAiB,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI;IAKvE,cAAc,CAAC,SAAS,EAAE,GAAG,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI;IAKpE,WAAW,IAAI,SAAS;IAKxB,iBAAiB,IAAI,SAAS;IAK9B,SAAS,IAAI,SAAS;IAKtB,aAAa,IAAI,SAAS;IAK1B,YAAY,IAAI,SAAS;IAIzB,WAAW,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI;IAI7C,eAAe,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,GAAG,IAAI;CAGlD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bytes } from "#@typeberry/bytes";
|
|
1
|
+
import { Bytes, BytesBlob } from "#@typeberry/bytes";
|
|
2
2
|
import { HASH_SIZE } from "#@typeberry/hash";
|
|
3
3
|
import { general } from "#@typeberry/jam-host-calls";
|
|
4
4
|
import { getEncodedConstants } from "./fetch-externalities.js";
|
|
@@ -15,29 +15,37 @@ export class RefineFetchExternalities {
|
|
|
15
15
|
entropy() {
|
|
16
16
|
return Bytes.zero(HASH_SIZE).asOpaque();
|
|
17
17
|
}
|
|
18
|
+
// TODO [ToDr] implement
|
|
18
19
|
authorizerTrace() {
|
|
19
|
-
return
|
|
20
|
+
return BytesBlob.empty();
|
|
20
21
|
}
|
|
22
|
+
// TODO [ToDr] implement
|
|
21
23
|
workItemExtrinsic(_workItem, _index) {
|
|
22
24
|
return null;
|
|
23
25
|
}
|
|
26
|
+
// TODO [ToDr] implement
|
|
24
27
|
workItemImport(_workItem, _index) {
|
|
25
28
|
return null;
|
|
26
29
|
}
|
|
30
|
+
// TODO [ToDr] implement
|
|
27
31
|
workPackage() {
|
|
28
|
-
return
|
|
32
|
+
return BytesBlob.empty();
|
|
29
33
|
}
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
// TODO [ToDr] implement
|
|
35
|
+
authConfiguration() {
|
|
36
|
+
return BytesBlob.empty();
|
|
32
37
|
}
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
// TODO [ToDr] implement
|
|
39
|
+
authToken() {
|
|
40
|
+
return BytesBlob.empty();
|
|
35
41
|
}
|
|
42
|
+
// TODO [ToDr] implement
|
|
36
43
|
refineContext() {
|
|
37
|
-
return
|
|
44
|
+
return BytesBlob.empty();
|
|
38
45
|
}
|
|
46
|
+
// TODO [ToDr] implement
|
|
39
47
|
allWorkItems() {
|
|
40
|
-
return
|
|
48
|
+
return BytesBlob.empty();
|
|
41
49
|
}
|
|
42
50
|
oneWorkItem(_workItem) {
|
|
43
51
|
return null;
|