@helios-lang/contract-utils 0.4.0 → 0.4.1
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helios-lang/contract-utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Convenience and type-safety utilities for using Helios validators from within Typescript",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@helios-lang/codec-utils": "^0.3.4",
|
|
41
41
|
"@helios-lang/compiler-utils": "^0.5.13",
|
|
42
42
|
"@helios-lang/crypto": "0.2.3",
|
|
43
|
-
"@helios-lang/ledger": "^0.8.
|
|
43
|
+
"@helios-lang/ledger": "^0.8.2",
|
|
44
44
|
"@helios-lang/type-utils": "^0.2.9",
|
|
45
|
-
"@helios-lang/uplc": "^0.8.
|
|
45
|
+
"@helios-lang/uplc": "^0.8.3"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "pnpm run prettify && pnpm run build:types && pnpm run test:suite",
|
|
@@ -120,13 +120,11 @@ class CompilerLib_v0_17 {
|
|
|
120
120
|
const ir = options.debug ? uplc.ir : undefined
|
|
121
121
|
const altIr = options.debug ? alt?.ir : undefined
|
|
122
122
|
const sourceMap = makeUplcSourceMap({
|
|
123
|
-
term:
|
|
123
|
+
term: uplc.root
|
|
124
124
|
}).toJsonSafe()
|
|
125
125
|
const altSourceMap = alt
|
|
126
126
|
? makeUplcSourceMap({
|
|
127
|
-
term:
|
|
128
|
-
alt.root
|
|
129
|
-
)
|
|
127
|
+
term: alt.root
|
|
130
128
|
}).toJsonSafe()
|
|
131
129
|
: undefined
|
|
132
130
|
|
|
@@ -164,7 +162,7 @@ class CompilerLib_v0_17 {
|
|
|
164
162
|
})
|
|
165
163
|
|
|
166
164
|
const sourceMap = makeUplcSourceMap({
|
|
167
|
-
term:
|
|
165
|
+
term: uplc.root
|
|
168
166
|
})
|
|
169
167
|
|
|
170
168
|
return {
|
|
@@ -186,43 +184,3 @@ class CompilerLib_v0_17 {
|
|
|
186
184
|
return analyzeMulti(validatorSources, moduleSources)
|
|
187
185
|
}
|
|
188
186
|
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @param {UplcTerm} root
|
|
192
|
-
* @returns {UplcTerm}
|
|
193
|
-
*/
|
|
194
|
-
function changeUplcCallTermsToUplcApply(root) {
|
|
195
|
-
if (
|
|
196
|
-
root.kind == "apply" ||
|
|
197
|
-
root.kind == "builtin" ||
|
|
198
|
-
root.kind == "case" ||
|
|
199
|
-
root.kind == "const" ||
|
|
200
|
-
root.kind == "constr" ||
|
|
201
|
-
root.kind == "error" ||
|
|
202
|
-
root.kind == "var"
|
|
203
|
-
) {
|
|
204
|
-
return root
|
|
205
|
-
} else if (root.kind == "delay") {
|
|
206
|
-
return makeUplcDelay({
|
|
207
|
-
arg: changeUplcCallTermsToUplcApply(root.arg),
|
|
208
|
-
site: root.site
|
|
209
|
-
})
|
|
210
|
-
} else if (root.kind == "force") {
|
|
211
|
-
return makeUplcForce({
|
|
212
|
-
arg: changeUplcCallTermsToUplcApply(root.arg),
|
|
213
|
-
site: root.site
|
|
214
|
-
})
|
|
215
|
-
} else if (root.kind == "lambda") {
|
|
216
|
-
return makeUplcLambda({
|
|
217
|
-
body: changeUplcCallTermsToUplcApply(root.children[0]),
|
|
218
|
-
site: root.site
|
|
219
|
-
})
|
|
220
|
-
} else {
|
|
221
|
-
const term = /** @type {any} */ (root)
|
|
222
|
-
return makeUplcApply({
|
|
223
|
-
fn: changeUplcCallTermsToUplcApply(term.fn),
|
|
224
|
-
arg: changeUplcCallTermsToUplcApply(term.arg),
|
|
225
|
-
site: term.site
|
|
226
|
-
})
|
|
227
|
-
}
|
|
228
|
-
}
|