@helios-lang/contract-utils 0.2.19 → 0.2.21
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/src/codegen/LoadedValidator.js +1 -0
- package/src/context/DagCompiler.js +20 -5
- package/types/codegen/LoadedValidator.d.ts +3 -0
- package/types/codegen/LoadedValidator.d.ts.map +1 -1
- package/types/context/DagCompiler.d.ts +2 -1
- package/types/context/DagCompiler.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import { UserFunc } from "../cast/UserFunc.js"
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
+
* * Note: `$hashDependencies` doesn't contain the indirect dependencies! It must be kept to a minimum in order to inform in which order the validators must be compiled
|
|
15
16
|
* @typedef {{
|
|
16
17
|
* $name: string
|
|
17
18
|
* $sourceCode: string
|
|
@@ -261,16 +261,31 @@ export class DagCompiler {
|
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
|
+
* Also returns the hash types of any hash-dependencies
|
|
264
265
|
* @private
|
|
265
266
|
* @param {LoadedValidator[]} validators
|
|
266
|
-
* @returns {
|
|
267
|
+
* @returns {Record<string, any>}
|
|
267
268
|
*/
|
|
268
269
|
getHashTypes(validators) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
/**
|
|
271
|
+
* @type {Record<string, any>}
|
|
272
|
+
*/
|
|
273
|
+
const res = {}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @param {ReadonlyArray<LoadedValidator>} vs
|
|
277
|
+
*/
|
|
278
|
+
const addHashes = (vs) => {
|
|
279
|
+
vs.forEach((v) => {
|
|
280
|
+
res[v.$name] = this.lib.getScriptHashType(v.$purpose)
|
|
281
|
+
|
|
282
|
+
addHashes(v.$hashDependencies)
|
|
272
283
|
})
|
|
273
|
-
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
addHashes(validators)
|
|
287
|
+
|
|
288
|
+
return res
|
|
274
289
|
}
|
|
275
290
|
}
|
|
276
291
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type CastLike<TStrict, TPermissive> = import("../cast/Cast.js").CastLike<TStrict, TPermissive>;
|
|
2
2
|
export type UplcProgram = import("@helios-lang/uplc").UplcProgram;
|
|
3
3
|
export type LoadedModule = import("./LoadedModule.js").LoadedModule;
|
|
4
|
+
/**
|
|
5
|
+
* * Note: `$hashDependencies` doesn't contain the indirect dependencies! It must be kept to a minimum in order to inform in which order the validators must be compiled
|
|
6
|
+
*/
|
|
4
7
|
export type LoadedValidator = {
|
|
5
8
|
$name: string;
|
|
6
9
|
$sourceCode: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadedValidator.d.ts","sourceRoot":"","sources":["../../src/codegen/LoadedValidator.js"],"names":[],"mappings":"6CAKa,OAAO,iBAAiB,EAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;0BAIxD,OAAO,mBAAmB,EAAE,WAAW;2BACvC,OAAO,mBAAmB,EAAE,YAAY
|
|
1
|
+
{"version":3,"file":"LoadedValidator.d.ts","sourceRoot":"","sources":["../../src/codegen/LoadedValidator.js"],"names":[],"mappings":"6CAKa,OAAO,iBAAiB,EAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;0BAIxD,OAAO,mBAAmB,EAAE,WAAW;2BACvC,OAAO,mBAAmB,EAAE,YAAY;;;;;WAMzC,MAAM;iBACA,MAAM;mBACJ,cAAc,YAAY,CAAC;uBACvB,cAAc,eAAe,CAAC;uBAC9B,OAAO;;;;;+BAEU,WAAW,KAAK,SAAS,GAAG,CAAC;;eACtD,SAAS,GAAG,EAAE,GAAG,CAAC;;cAGjB,UAAU,GAAG,OAAO;YACtB,SAAS,GAAG,EAAE,GAAG,CAAC;;cAEhB,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS;;;WAM7C,MAAM;;;;;WAOQ,MAAM;;;;6DAM7B,0BAA0B,CAAC,CAAC,eAAe,CAAC,CAAC;yBAhDjC,qBAAqB"}
|
|
@@ -74,9 +74,10 @@ export class DagCompiler {
|
|
|
74
74
|
*/
|
|
75
75
|
private getHashDependencies;
|
|
76
76
|
/**
|
|
77
|
+
* Also returns the hash types of any hash-dependencies
|
|
77
78
|
* @private
|
|
78
79
|
* @param {LoadedValidator[]} validators
|
|
79
|
-
* @returns {
|
|
80
|
+
* @returns {Record<string, any>}
|
|
80
81
|
*/
|
|
81
82
|
private getHashTypes;
|
|
82
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DagCompiler.d.ts","sourceRoot":"","sources":["../../src/context/DagCompiler.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DagCompiler.d.ts","sourceRoot":"","sources":["../../src/context/DagCompiler.js"],"names":[],"mappings":"AAmSA;;;GAGG;AACH,iDAHW,eAAe,GACb,MAAM,EAAE,CAsBpB;AAjTD;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;GAEG;AACH;IA6BI;;;OAGG;IACH,iBAHW,WAAW,cACX,UAAU,EAOpB;IArCD;;;;OAIG;IACH,qBAAG;IAEH;;;;OAIG;IACH,wBAAM;IAEN;;;;OAIG;IACH,kCAAgB;IAEhB;;;;OAIG;IACH,iCAAe;IAQX,iDAA4B;IAKhC;;;;;;OAMG;IACH,kBANW,eAAe,EAAE,cACjB,OAAO,MAAM,EAAE,GAAG,CAAC,aACnB,OAAO;;SAEL,iBAAiB,CA2H7B;IAED;;;;;OAKG;IACH,4BA6BC;IAED;;;;OAIG;IACH,4BAoBC;IAED;;;;;OAKG;IACH,qBAoBC;CACJ;0BAtRY,OAAO,mBAAmB,EAAE,WAAW;yBACvC,OAAO,kBAAkB,EAAE,UAAU;8BACrC,OAAO,+BAA+B,EAAE,eAAe;0BACvD,OAAO,sBAAsB,EAAE,WAAW;0CAC1C,OAAO,sBAAsB,EAAE,2BAA2B"}
|