@taquito/michel-codec 13.0.0 → 14.0.0
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/binary.js +3 -2
- package/dist/lib/binary.js.map +1 -1
- package/dist/lib/michelson-contract.js +3 -1
- package/dist/lib/michelson-contract.js.map +1 -1
- package/dist/lib/michelson-typecheck.js +9 -0
- package/dist/lib/michelson-typecheck.js.map +1 -1
- package/dist/lib/michelson-types.js +3 -1
- package/dist/lib/michelson-types.js.map +1 -1
- package/dist/lib/michelson-validator.js +9 -0
- package/dist/lib/michelson-validator.js.map +1 -1
- package/dist/lib/version.js +2 -2
- package/dist/taquito-michel-codec.es6.js +30 -8
- package/dist/taquito-michel-codec.es6.js.map +1 -1
- package/dist/taquito-michel-codec.umd.js +30 -8
- package/dist/taquito-michel-codec.umd.js.map +1 -1
- package/dist/types/michelson-types.d.ts +3 -2
- package/package.json +9 -9
|
@@ -148,6 +148,7 @@ var Protocol;
|
|
|
148
148
|
Protocol["Psithaca2"] = "Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A";
|
|
149
149
|
Protocol["PtJakarta"] = "PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw";
|
|
150
150
|
Protocol["PtJakart2"] = "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY";
|
|
151
|
+
Protocol["PtKathman"] = "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg";
|
|
151
152
|
Protocol["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK";
|
|
152
153
|
})(Protocol || (Protocol = {}));
|
|
153
154
|
const DefaultProtocol = Protocol.Psithaca2;
|
|
@@ -171,7 +172,8 @@ const protoLevel = {
|
|
|
171
172
|
Psithaca2MLRFYargivpo7YvUr7wUDqyxrdhC5CQq78mRvimz6A: 12,
|
|
172
173
|
PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw: 13,
|
|
173
174
|
PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY: 13,
|
|
174
|
-
|
|
175
|
+
PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg: 14,
|
|
176
|
+
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 15,
|
|
175
177
|
};
|
|
176
178
|
function ProtoGreaterOfEqual(a, b) {
|
|
177
179
|
return protoLevel[a] >= protoLevel[b];
|
|
@@ -1950,6 +1952,7 @@ const instructionIDs = Object.assign({}, noArgInstructionIDs, {
|
|
|
1950
1952
|
DROP: true,
|
|
1951
1953
|
DUG: true,
|
|
1952
1954
|
DUP: true,
|
|
1955
|
+
EMIT: true,
|
|
1953
1956
|
EMPTY_BIG_MAP: true,
|
|
1954
1957
|
EMPTY_MAP: true,
|
|
1955
1958
|
EMPTY_SET: true,
|
|
@@ -2241,6 +2244,14 @@ function assertMichelsonInstruction(ex) {
|
|
|
2241
2244
|
}
|
|
2242
2245
|
}
|
|
2243
2246
|
break;
|
|
2247
|
+
case 'EMIT':
|
|
2248
|
+
if (ex.args && ex.args.length > 0) {
|
|
2249
|
+
assertArgs(ex, 1);
|
|
2250
|
+
}
|
|
2251
|
+
else {
|
|
2252
|
+
assertArgs(ex, 0);
|
|
2253
|
+
}
|
|
2254
|
+
break;
|
|
2244
2255
|
default:
|
|
2245
2256
|
throw new MichelsonValidationError(ex, 'instruction expected');
|
|
2246
2257
|
}
|
|
@@ -2644,7 +2655,7 @@ function assertDataListIfAny(d) {
|
|
|
2644
2655
|
return true;
|
|
2645
2656
|
}
|
|
2646
2657
|
|
|
2647
|
-
|
|
2658
|
+
/******************************************************************************
|
|
2648
2659
|
Copyright (c) Microsoft Corporation.
|
|
2649
2660
|
|
|
2650
2661
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -2820,6 +2831,7 @@ const primitives = [
|
|
|
2820
2831
|
'view',
|
|
2821
2832
|
'constant',
|
|
2822
2833
|
'SUB_MUTEZ',
|
|
2834
|
+
'EMIT',
|
|
2823
2835
|
];
|
|
2824
2836
|
const primTags = Object.assign({}, ...primitives.map((v, i) => ({ [v]: i })));
|
|
2825
2837
|
var Tag;
|
|
@@ -3605,14 +3617,14 @@ function packDataBytes(d, t) {
|
|
|
3605
3617
|
}
|
|
3606
3618
|
const getReadTransformFuncs = (t) => {
|
|
3607
3619
|
if (isPairType(t)) {
|
|
3608
|
-
const args = Array.isArray(t) ? t : t.args;
|
|
3609
3620
|
return [
|
|
3610
3621
|
(d) => {
|
|
3611
3622
|
if (!isPairData(d)) {
|
|
3612
3623
|
throw new MichelsonTypeError(t, d, `pair expected: ${JSON.stringify(d)}`);
|
|
3613
3624
|
}
|
|
3625
|
+
const tc = unpackComb('pair', t);
|
|
3614
3626
|
return (function* () {
|
|
3615
|
-
for (const a of args) {
|
|
3627
|
+
for (const a of tc.args) {
|
|
3616
3628
|
yield getReadTransformFuncs(a);
|
|
3617
3629
|
}
|
|
3618
3630
|
})();
|
|
@@ -5316,6 +5328,15 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
5316
5328
|
}
|
|
5317
5329
|
case 'MIN_BLOCK_TIME':
|
|
5318
5330
|
return [annotateVar({ prim: 'nat' }), ...stack];
|
|
5331
|
+
case 'EMIT': {
|
|
5332
|
+
const ia = instructionAnn({ f: 1, t: 1 });
|
|
5333
|
+
if (instruction.args) {
|
|
5334
|
+
const s = args(0, null);
|
|
5335
|
+
ensureTypesEqual(s[0], instruction.args[0]);
|
|
5336
|
+
return [annotate({ prim: 'operation' }, ia), ...stack.slice(1)];
|
|
5337
|
+
}
|
|
5338
|
+
return [annotate({ prim: 'operation' }, ia), ...stack.slice(1)];
|
|
5339
|
+
}
|
|
5319
5340
|
default:
|
|
5320
5341
|
throw new MichelsonError(instruction, `unexpected instruction: ${instruction.prim}`);
|
|
5321
5342
|
}
|
|
@@ -5525,10 +5546,11 @@ class Contract {
|
|
|
5525
5546
|
if (expr === null) {
|
|
5526
5547
|
throw new InvalidTypeExpressionError('empty type expression');
|
|
5527
5548
|
}
|
|
5528
|
-
if
|
|
5549
|
+
// remove assertTypeAnnotationsValid from if block because: () => void || throw error
|
|
5550
|
+
if (assertMichelsonType(expr)) {
|
|
5551
|
+
assertTypeAnnotationsValid(expr);
|
|
5529
5552
|
return expr;
|
|
5530
5553
|
}
|
|
5531
|
-
throw undefined;
|
|
5532
5554
|
}
|
|
5533
5555
|
static parseDataExpression(src, opt) {
|
|
5534
5556
|
const p = new Parser(opt);
|
|
@@ -5639,8 +5661,8 @@ ${err.data
|
|
|
5639
5661
|
|
|
5640
5662
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
5641
5663
|
const VERSION = {
|
|
5642
|
-
"commitHash": "
|
|
5643
|
-
"version": "
|
|
5664
|
+
"commitHash": "b1a433145402043facaec3519daceb21a305deef",
|
|
5665
|
+
"version": "14.0.0"
|
|
5644
5666
|
};
|
|
5645
5667
|
|
|
5646
5668
|
export { Contract, DefaultProtocol, JSONParseError, MacroError, MichelineParseError, MichelsonError, MichelsonInstructionError, MichelsonTypeError, MichelsonValidationError, Parser, ProtoGreaterOfEqual, ProtoInferiorTo, Protocol, VERSION, assertContractValid, assertDataListIfAny, assertDataValid, assertMichelsonBigMapStorableType, assertMichelsonComparableType, assertMichelsonContract, assertMichelsonData, assertMichelsonInstruction, assertMichelsonPackableType, assertMichelsonPassableType, assertMichelsonPushableType, assertMichelsonStorableType, assertMichelsonType, assertTypeAnnotationsValid, assertTypesEqual, assertViewNameValid, contractEntryPoint, contractEntryPoints, contractSection, contractViews, decodeAddressBytes, decodePublicKeyBytes, decodePublicKeyHashBytes, dummyContract, emitMicheline, formatError, formatStack, functionType, instructionIDs, isContractValid, isDataValid, isInstruction, isMichelsonCode, isMichelsonData, isMichelsonError, isMichelsonScript, isMichelsonType, isTypeAnnotationsValid, isTypeEqual, packData, packDataBytes, refContract, sourceReference, traceDumpFunc, unpackData, unpackDataBytes };
|