@taquito/michel-codec 14.2.0 → 15.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 +10 -2
- package/dist/lib/binary.js.map +1 -1
- package/dist/lib/michelson-typecheck.js +23 -5
- 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 +47 -10
- package/dist/taquito-michel-codec.es6.js.map +1 -1
- package/dist/taquito-michel-codec.umd.js +47 -10
- package/dist/taquito-michel-codec.umd.js.map +1 -1
- package/dist/types/michelson-types.d.ts +8 -6
- package/package.json +2 -2
|
@@ -149,6 +149,7 @@ var Protocol;
|
|
|
149
149
|
Protocol["PtJakarta"] = "PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw";
|
|
150
150
|
Protocol["PtJakart2"] = "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY";
|
|
151
151
|
Protocol["PtKathman"] = "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg";
|
|
152
|
+
Protocol["PtLimaPtL"] = "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW";
|
|
152
153
|
Protocol["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK";
|
|
153
154
|
})(Protocol || (Protocol = {}));
|
|
154
155
|
const DefaultProtocol = Protocol.Psithaca2;
|
|
@@ -173,7 +174,8 @@ const protoLevel = {
|
|
|
173
174
|
PtJakartaiDz69SfDDLXJSiuZqTSeSKRDbKVZC8MNzJnvRjvnGw: 13,
|
|
174
175
|
PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY: 13,
|
|
175
176
|
PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg: 14,
|
|
176
|
-
|
|
177
|
+
PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW: 15,
|
|
178
|
+
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 16,
|
|
177
179
|
};
|
|
178
180
|
function ProtoGreaterOfEqual(a, b) {
|
|
179
181
|
return protoLevel[a] >= protoLevel[b];
|
|
@@ -1934,6 +1936,7 @@ const noArgInstructionIDs = {
|
|
|
1934
1936
|
SUB: true,
|
|
1935
1937
|
SWAP: true,
|
|
1936
1938
|
TICKET: true,
|
|
1939
|
+
TICKET_DEPRECATED: true,
|
|
1937
1940
|
TOTAL_VOTING_POWER: true,
|
|
1938
1941
|
TRANSFER_TOKENS: true,
|
|
1939
1942
|
UNIT: true,
|
|
@@ -1963,6 +1966,7 @@ const instructionIDs = Object.assign({}, noArgInstructionIDs, {
|
|
|
1963
1966
|
IF_NONE: true,
|
|
1964
1967
|
ITER: true,
|
|
1965
1968
|
LAMBDA: true,
|
|
1969
|
+
LAMBDA_REC: true,
|
|
1966
1970
|
LEFT: true,
|
|
1967
1971
|
LOOP: true,
|
|
1968
1972
|
LOOP_LEFT: true,
|
|
@@ -2011,6 +2015,7 @@ const typeIDs = Object.assign({}, simpleComparableTypeIDs, {
|
|
|
2011
2015
|
bls12_381_g2: true,
|
|
2012
2016
|
bls12_381_fr: true,
|
|
2013
2017
|
sapling_transaction: true,
|
|
2018
|
+
sapling_transaction_deprecated: true,
|
|
2014
2019
|
sapling_state: true,
|
|
2015
2020
|
ticket: true,
|
|
2016
2021
|
chest_key: true,
|
|
@@ -2222,6 +2227,7 @@ function assertMichelsonInstruction(ex) {
|
|
|
2222
2227
|
assertMichelsonBigMapStorableType(ex.args[1]);
|
|
2223
2228
|
}
|
|
2224
2229
|
break;
|
|
2230
|
+
case 'LAMBDA_REC':
|
|
2225
2231
|
case 'LAMBDA':
|
|
2226
2232
|
/* istanbul ignore else */
|
|
2227
2233
|
if (assertArgs(ex, 3)) {
|
|
@@ -2503,6 +2509,11 @@ function assertMichelsonData(ex) {
|
|
|
2503
2509
|
assertMichelsonData(ex.args[0]);
|
|
2504
2510
|
}
|
|
2505
2511
|
break;
|
|
2512
|
+
case 'Lambda_rec':
|
|
2513
|
+
if (ex.args) {
|
|
2514
|
+
assertMichelsonInstruction(ex.args);
|
|
2515
|
+
}
|
|
2516
|
+
break;
|
|
2506
2517
|
default:
|
|
2507
2518
|
if (Object.prototype.hasOwnProperty.call(instructionIDs, ex.prim)) {
|
|
2508
2519
|
assertMichelsonInstruction(ex);
|
|
@@ -2682,6 +2693,8 @@ function __rest(s, e) {
|
|
|
2682
2693
|
return t;
|
|
2683
2694
|
}
|
|
2684
2695
|
|
|
2696
|
+
// The order is important!
|
|
2697
|
+
// The position represent the encoding value.
|
|
2685
2698
|
const primitives = [
|
|
2686
2699
|
'parameter',
|
|
2687
2700
|
'storage',
|
|
@@ -2815,11 +2828,11 @@ const primitives = [
|
|
|
2815
2828
|
'bls12_381_g2',
|
|
2816
2829
|
'bls12_381_fr',
|
|
2817
2830
|
'sapling_state',
|
|
2818
|
-
'
|
|
2831
|
+
'sapling_transaction_deprecated',
|
|
2819
2832
|
'SAPLING_EMPTY_STATE',
|
|
2820
2833
|
'SAPLING_VERIFY_UPDATE',
|
|
2821
2834
|
'ticket',
|
|
2822
|
-
'
|
|
2835
|
+
'TICKET_DEPRECATED',
|
|
2823
2836
|
'READ_TICKET',
|
|
2824
2837
|
'SPLIT_TICKET',
|
|
2825
2838
|
'JOIN_TICKETS',
|
|
@@ -2831,7 +2844,13 @@ const primitives = [
|
|
|
2831
2844
|
'view',
|
|
2832
2845
|
'constant',
|
|
2833
2846
|
'SUB_MUTEZ',
|
|
2847
|
+
'tx_rollup_l2_address',
|
|
2848
|
+
'MIN_BLOCK_TIME',
|
|
2849
|
+
'sapling_transaction',
|
|
2834
2850
|
'EMIT',
|
|
2851
|
+
'Lambda_rec',
|
|
2852
|
+
'LAMBDA_REC',
|
|
2853
|
+
'TICKET',
|
|
2835
2854
|
];
|
|
2836
2855
|
const primTags = Object.assign({}, ...primitives.map((v, i) => ({ [v]: i })));
|
|
2837
2856
|
var Tag;
|
|
@@ -5181,10 +5200,15 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
5181
5200
|
annotate({ prim: 'big_map', args: instruction.args }, instructionAnn({ t: 1, v: 1 })),
|
|
5182
5201
|
...stack,
|
|
5183
5202
|
];
|
|
5203
|
+
case 'LAMBDA_REC':
|
|
5184
5204
|
case 'LAMBDA': {
|
|
5185
5205
|
assertTypeAnnotationsValid(instruction.args[0]);
|
|
5186
5206
|
assertTypeAnnotationsValid(instruction.args[1]);
|
|
5187
|
-
const
|
|
5207
|
+
const s = [instruction.args[0]];
|
|
5208
|
+
if (instruction.prim === "LAMBDA_REC") {
|
|
5209
|
+
s.push({ prim: 'lambda', args: [instruction.args[0], instruction.args[1]] });
|
|
5210
|
+
}
|
|
5211
|
+
const body = functionTypeInternal(instruction.args[2], s, Object.assign(Object.assign({}, ctx), { contract: undefined }));
|
|
5188
5212
|
if ('failed' in body) {
|
|
5189
5213
|
return { failed: body.failed, level: body.level + 1 };
|
|
5190
5214
|
}
|
|
@@ -5207,10 +5231,23 @@ function functionTypeInternal(inst, stack, ctx) {
|
|
|
5207
5231
|
case 'TICKET': {
|
|
5208
5232
|
const s = args(0, null, ['nat'])[0];
|
|
5209
5233
|
ensureComparableType(s);
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5234
|
+
if (ProtoInferiorTo(proto, Protocol.PtLimaPtL)) {
|
|
5235
|
+
return [
|
|
5236
|
+
annotate({ prim: 'ticket', args: [s] }, instructionAnn({ t: 1, v: 1 })),
|
|
5237
|
+
...stack.slice(2),
|
|
5238
|
+
];
|
|
5239
|
+
}
|
|
5240
|
+
else {
|
|
5241
|
+
return [
|
|
5242
|
+
annotateVar({
|
|
5243
|
+
prim: 'option',
|
|
5244
|
+
args: [
|
|
5245
|
+
annotate({ prim: 'ticket', args: [s] }, instructionAnn({ t: 1, v: 1 }))
|
|
5246
|
+
]
|
|
5247
|
+
}),
|
|
5248
|
+
...stack.slice(2)
|
|
5249
|
+
];
|
|
5250
|
+
}
|
|
5214
5251
|
}
|
|
5215
5252
|
case 'JOIN_TICKETS': {
|
|
5216
5253
|
const s = unpackComb('pair', args(0, ['pair'])[0]);
|
|
@@ -5661,8 +5698,8 @@ ${err.data
|
|
|
5661
5698
|
|
|
5662
5699
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
|
|
5663
5700
|
const VERSION = {
|
|
5664
|
-
"commitHash": "
|
|
5665
|
-
"version": "
|
|
5701
|
+
"commitHash": "ebe5353579be0da07c664f4b294516acdc429f6e",
|
|
5702
|
+
"version": "15.0.0"
|
|
5666
5703
|
};
|
|
5667
5704
|
|
|
5668
5705
|
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 };
|