@taquito/michel-codec 24.2.0 → 24.3.0-beta.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/dist/lib/base58.js +1 -1
- package/dist/lib/binary.js +2 -3
- package/dist/lib/errors.js +7 -7
- package/dist/lib/formatters.js +2 -4
- package/dist/lib/macros.js +9 -6
- package/dist/lib/micheline-emitter.js +4 -8
- package/dist/lib/micheline-parser.js +13 -14
- package/dist/lib/michelson-contract.js +3 -3
- package/dist/lib/michelson-typecheck.js +61 -57
- package/dist/lib/michelson-validator.js +7 -9
- package/dist/lib/scan.js +1 -1
- package/dist/lib/utils.js +12 -10
- package/dist/lib/version.js +2 -2
- package/dist/taquito-michel-codec.es6.js +124 -148
- package/dist/taquito-michel-codec.es6.js.map +1 -1
- package/dist/taquito-michel-codec.umd.js +124 -148
- package/dist/taquito-michel-codec.umd.js.map +1 -1
- package/dist/types/base58.d.ts +1 -1
- package/dist/types/errors.d.ts +7 -7
- package/dist/types/macros.d.ts +1 -1
- package/dist/types/micheline-parser.d.ts +2 -2
- package/dist/types/scan.d.ts +1 -1
- package/dist/types/utils.d.ts +1 -2
- package/package.json +22 -8
- package/LICENSE +0 -202
|
@@ -234,8 +234,7 @@ function assertStringOrBytes(ex) {
|
|
|
234
234
|
throw new MichelsonValidationError(ex, 'string or bytes literal expected');
|
|
235
235
|
}
|
|
236
236
|
function assertArgs(ex, n) {
|
|
237
|
-
|
|
238
|
-
if ((n === 0 && ex.args === undefined) || ((_a = ex.args) === null || _a === void 0 ? void 0 : _a.length) === n) {
|
|
237
|
+
if ((n === 0 && ex.args === undefined) || ex.args?.length === n) {
|
|
239
238
|
return true;
|
|
240
239
|
}
|
|
241
240
|
throw new MichelsonValidationError(ex, `${n} arguments expected`);
|
|
@@ -246,7 +245,6 @@ function assertArgs(ex, n) {
|
|
|
246
245
|
* @param ex An AST node
|
|
247
246
|
*/
|
|
248
247
|
function assertMichelsonInstruction(ex) {
|
|
249
|
-
var _a, _b;
|
|
250
248
|
if (Array.isArray(ex)) {
|
|
251
249
|
for (const n of ex) {
|
|
252
250
|
if (!Array.isArray(n) && !isPrim(n)) {
|
|
@@ -340,7 +338,7 @@ function assertMichelsonInstruction(ex) {
|
|
|
340
338
|
}
|
|
341
339
|
break;
|
|
342
340
|
case 'DIP':
|
|
343
|
-
if (
|
|
341
|
+
if (ex.args?.length === 2) {
|
|
344
342
|
/* istanbul ignore else */
|
|
345
343
|
if (assertIntLiteral(ex.args[0])) {
|
|
346
344
|
assertNatural(ex.args[0]);
|
|
@@ -350,7 +348,7 @@ function assertMichelsonInstruction(ex) {
|
|
|
350
348
|
assertMichelsonInstruction(ex.args[1]);
|
|
351
349
|
}
|
|
352
350
|
}
|
|
353
|
-
else if (
|
|
351
|
+
else if (ex.args?.length === 1) {
|
|
354
352
|
/* istanbul ignore else */
|
|
355
353
|
if (assertSeq(ex.args[0])) {
|
|
356
354
|
assertMichelsonInstruction(ex.args[0]);
|
|
@@ -771,7 +769,7 @@ function isMichelsonScript(ex) {
|
|
|
771
769
|
assertMichelsonContract(ex);
|
|
772
770
|
return true;
|
|
773
771
|
}
|
|
774
|
-
catch
|
|
772
|
+
catch {
|
|
775
773
|
return false;
|
|
776
774
|
}
|
|
777
775
|
}
|
|
@@ -784,7 +782,7 @@ function isMichelsonData(ex) {
|
|
|
784
782
|
assertMichelsonData(ex);
|
|
785
783
|
return true;
|
|
786
784
|
}
|
|
787
|
-
catch
|
|
785
|
+
catch {
|
|
788
786
|
return false;
|
|
789
787
|
}
|
|
790
788
|
}
|
|
@@ -797,7 +795,7 @@ function isMichelsonCode(ex) {
|
|
|
797
795
|
assertMichelsonInstruction(ex);
|
|
798
796
|
return true;
|
|
799
797
|
}
|
|
800
|
-
catch
|
|
798
|
+
catch {
|
|
801
799
|
return false;
|
|
802
800
|
}
|
|
803
801
|
}
|
|
@@ -810,7 +808,7 @@ function isMichelsonType(ex) {
|
|
|
810
808
|
assertMichelsonType(ex);
|
|
811
809
|
return true;
|
|
812
810
|
}
|
|
813
|
-
catch
|
|
811
|
+
catch {
|
|
814
812
|
return false;
|
|
815
813
|
}
|
|
816
814
|
}
|
package/dist/lib/scan.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.scan = scan;
|
|
|
5
5
|
const core_1 = require("@taquito/core");
|
|
6
6
|
/**
|
|
7
7
|
* @category Error
|
|
8
|
-
*
|
|
8
|
+
* Error that indicates a failure when performing the scan step when parsing Michelson
|
|
9
9
|
*/
|
|
10
10
|
class ScanError extends core_1.TaquitoError {
|
|
11
11
|
constructor(src, idx, message) {
|
package/dist/lib/utils.js
CHANGED
|
@@ -20,12 +20,11 @@ const errors_1 = require("./errors");
|
|
|
20
20
|
const core_1 = require("@taquito/core");
|
|
21
21
|
/**
|
|
22
22
|
* @category Error
|
|
23
|
-
*
|
|
23
|
+
* Error that indicates a Michelson failure occurring
|
|
24
24
|
*/
|
|
25
25
|
class MichelsonError extends core_1.TaquitoError {
|
|
26
26
|
/**
|
|
27
27
|
* @param val Value of a AST node caused the error
|
|
28
|
-
* @param path Path to a node caused the error
|
|
29
28
|
* @param message An error message
|
|
30
29
|
*/
|
|
31
30
|
constructor(val, message) {
|
|
@@ -149,7 +148,7 @@ function isDecimal(x) {
|
|
|
149
148
|
new LongInteger(x);
|
|
150
149
|
return true;
|
|
151
150
|
}
|
|
152
|
-
catch
|
|
151
|
+
catch {
|
|
153
152
|
return false;
|
|
154
153
|
}
|
|
155
154
|
}
|
|
@@ -157,7 +156,7 @@ function isNatural(x) {
|
|
|
157
156
|
try {
|
|
158
157
|
return new LongInteger(x).sign >= 0;
|
|
159
158
|
}
|
|
160
|
-
catch
|
|
159
|
+
catch {
|
|
161
160
|
return false;
|
|
162
161
|
}
|
|
163
162
|
}
|
|
@@ -173,13 +172,13 @@ function unpackAnnotations(p, opt) {
|
|
|
173
172
|
for (const v of p.annots) {
|
|
174
173
|
if (v.length !== 0) {
|
|
175
174
|
if (!annRe.test(v) ||
|
|
176
|
-
(!
|
|
177
|
-
(!
|
|
175
|
+
(!opt?.specialVar && (v === '@%' || v === '@%%')) ||
|
|
176
|
+
(!opt?.specialFields && v === '%@')) {
|
|
178
177
|
throw new MichelsonError(p, `${p.prim}: unexpected annotation: ${v}`);
|
|
179
178
|
}
|
|
180
179
|
switch (v[0]) {
|
|
181
180
|
case '%':
|
|
182
|
-
if (
|
|
181
|
+
if (opt?.emptyFields || v.length > 1) {
|
|
183
182
|
field = field || [];
|
|
184
183
|
field.push(v);
|
|
185
184
|
}
|
|
@@ -191,7 +190,7 @@ function unpackAnnotations(p, opt) {
|
|
|
191
190
|
}
|
|
192
191
|
break;
|
|
193
192
|
case '@':
|
|
194
|
-
if (
|
|
193
|
+
if (opt?.emptyVar || v.length > 1) {
|
|
195
194
|
vars = vars || [];
|
|
196
195
|
vars.push(v);
|
|
197
196
|
}
|
|
@@ -272,13 +271,16 @@ function unpackComb(id, v) {
|
|
|
272
271
|
};
|
|
273
272
|
return ret;
|
|
274
273
|
}
|
|
275
|
-
return
|
|
274
|
+
return {
|
|
275
|
+
...(Array.isArray(vv) ? { prim: id } : vv),
|
|
276
|
+
args: [
|
|
276
277
|
args[0],
|
|
277
278
|
{
|
|
278
279
|
prim: id,
|
|
279
280
|
args: args.slice(1),
|
|
280
281
|
},
|
|
281
|
-
]
|
|
282
|
+
],
|
|
283
|
+
};
|
|
282
284
|
}
|
|
283
285
|
function isPairType(t) {
|
|
284
286
|
return Array.isArray(t) || t.prim === 'pair';
|
package/dist/lib/version.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
5
5
|
exports.VERSION = {
|
|
6
|
-
"commitHash": "
|
|
7
|
-
"version": "24.
|
|
6
|
+
"commitHash": "05df48fee92f846cba793920d6fa829afd6a1847",
|
|
7
|
+
"version": "24.3.0-beta.1"
|
|
8
8
|
};
|