@helios-lang/contract-utils 0.1.18 → 0.1.19
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
CHANGED
|
@@ -103,20 +103,6 @@ export class ContractContextBuilder {
|
|
|
103
103
|
return new ContractContextBuilder({})
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
/**
|
|
107
|
-
* @template {Validator} V
|
|
108
|
-
* @param {V} validator
|
|
109
|
-
* @returns {ContractContextBuilder<T & {
|
|
110
|
-
* [K in V["$name"]]: V
|
|
111
|
-
* }>}
|
|
112
|
-
*/
|
|
113
|
-
with(validator) {
|
|
114
|
-
return new ContractContextBuilder({
|
|
115
|
-
...this.validators,
|
|
116
|
-
[validator.$name]: validator
|
|
117
|
-
})
|
|
118
|
-
}
|
|
119
|
-
|
|
120
106
|
/**
|
|
121
107
|
* @param {Module[]} modules
|
|
122
108
|
* @returns {ContractContextBuilder<T>}
|
|
@@ -126,15 +112,19 @@ export class ContractContextBuilder {
|
|
|
126
112
|
}
|
|
127
113
|
|
|
128
114
|
/**
|
|
129
|
-
* @
|
|
130
|
-
* @param {
|
|
131
|
-
* @returns {
|
|
115
|
+
* @template {Validator} V
|
|
116
|
+
* @param {V} validator
|
|
117
|
+
* @returns {ContractContextBuilder<T & {
|
|
118
|
+
* [K in V["$name"]]: V
|
|
119
|
+
* }>}
|
|
132
120
|
*/
|
|
133
|
-
|
|
134
|
-
return
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
121
|
+
with(validator) {
|
|
122
|
+
return new ContractContextBuilder(
|
|
123
|
+
{
|
|
124
|
+
...this.validators,
|
|
125
|
+
[validator.$name]: validator
|
|
126
|
+
},
|
|
127
|
+
this.forcedModules
|
|
138
128
|
)
|
|
139
129
|
}
|
|
140
130
|
|
|
@@ -170,6 +160,19 @@ export class ContractContextBuilder {
|
|
|
170
160
|
return result
|
|
171
161
|
}
|
|
172
162
|
|
|
163
|
+
/**
|
|
164
|
+
* @private
|
|
165
|
+
* @param {Lib} lib
|
|
166
|
+
* @returns {{[name: string]: any}}
|
|
167
|
+
*/
|
|
168
|
+
getValidatorTypes(lib) {
|
|
169
|
+
return Object.fromEntries(
|
|
170
|
+
Object.entries(this.validators).map(([name, v]) => {
|
|
171
|
+
return [name, lib.getValidatorType(v.$purpose)]
|
|
172
|
+
})
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
173
176
|
/**
|
|
174
177
|
* @param {Option<{[name: string]: string}>} expectedHashes
|
|
175
178
|
* @param {LibOptions} options
|
|
@@ -75,6 +75,11 @@ export class ContractContextBuilder<T extends {
|
|
|
75
75
|
* @type {Option<Module[]>}
|
|
76
76
|
*/
|
|
77
77
|
private readonly forcedModules;
|
|
78
|
+
/**
|
|
79
|
+
* @param {Module[]} modules
|
|
80
|
+
* @returns {ContractContextBuilder<T>}
|
|
81
|
+
*/
|
|
82
|
+
setModules(modules: Module[]): ContractContextBuilder<T>;
|
|
78
83
|
/**
|
|
79
84
|
* @template {Validator} V
|
|
80
85
|
* @param {V} validator
|
|
@@ -84,22 +89,17 @@ export class ContractContextBuilder<T extends {
|
|
|
84
89
|
*/
|
|
85
90
|
with<V extends Validator>(validator: V): ContractContextBuilder<T & { [K in V["$name"]]: V; }>;
|
|
86
91
|
/**
|
|
87
|
-
* @
|
|
88
|
-
* @
|
|
92
|
+
* @private
|
|
93
|
+
* @param {Validator} validator
|
|
94
|
+
* @returns {Map<string, string>}
|
|
89
95
|
*/
|
|
90
|
-
|
|
96
|
+
private getModules;
|
|
91
97
|
/**
|
|
92
98
|
* @private
|
|
93
99
|
* @param {Lib} lib
|
|
94
100
|
* @returns {{[name: string]: any}}
|
|
95
101
|
*/
|
|
96
102
|
private getValidatorTypes;
|
|
97
|
-
/**
|
|
98
|
-
* @private
|
|
99
|
-
* @param {Validator} validator
|
|
100
|
-
* @returns {Map<string, string>}
|
|
101
|
-
*/
|
|
102
|
-
private getModules;
|
|
103
103
|
/**
|
|
104
104
|
* @param {Option<{[name: string]: string}>} expectedHashes
|
|
105
105
|
* @param {LibOptions} options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractContextBuilder.d.ts","sourceRoot":"","sources":["../../src/runtime/ContractContextBuilder.js"],"names":[],"mappings":"AAaA;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH;;;IAyBI;;OAEG;IACH,gBAFa,uBAAuB,EAAE,CAAC,CAItC;IAfD;;;;OAIG;IACH,sBAGC;IAtBD;;;;OAIG;IACH,4BAAU;IAEV;;;;OAIG;IACH,+BAAa;IAmBb
|
|
1
|
+
{"version":3,"file":"ContractContextBuilder.d.ts","sourceRoot":"","sources":["../../src/runtime/ContractContextBuilder.js"],"names":[],"mappings":"AAaA;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH;;;IAyBI;;OAEG;IACH,gBAFa,uBAAuB,EAAE,CAAC,CAItC;IAfD;;;;OAIG;IACH,sBAGC;IAtBD;;;;OAIG;IACH,4BAAU;IAEV;;;;OAIG;IACH,+BAAa;IAmBb;;;OAGG;IACH,oBAHW,MAAM,EAAE,GACN,uBAAuB,CAAC,CAAC,CAIrC;IAED;;;;;;OAMG;IACH,+FAQC;IAED;;;;OAIG;IACH,mBAyBC;IAED;;;;OAIG;IACH,0BAMC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH;;kBAzBW,UAAU,qwBAiKpB;CACJ;kBArUY,OAAO,iBAAiB,EAAE,GAAG;yBAC7B,OAAO,iBAAiB,EAAE,UAAU;gCACpC,OAAO,sBAAsB,EAAE,SAAS;mEAMxC,OAAO,qBAA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