@taquito/michel-codec 15.1.0 → 16.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.
@@ -150,6 +150,8 @@ var Protocol;
150
150
  Protocol["PtJakart2"] = "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY";
151
151
  Protocol["PtKathman"] = "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg";
152
152
  Protocol["PtLimaPtL"] = "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW";
153
+ Protocol["PtMumbaii"] = "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc";
154
+ Protocol["PtMumbai2"] = "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1";
153
155
  Protocol["ProtoALpha"] = "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK";
154
156
  })(Protocol || (Protocol = {}));
155
157
  const DefaultProtocol = Protocol.Psithaca2;
@@ -175,7 +177,9 @@ const protoLevel = {
175
177
  PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY: 13,
176
178
  PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg: 14,
177
179
  PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW: 15,
178
- ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 16,
180
+ PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc: 16,
181
+ PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1: 16,
182
+ ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 17,
179
183
  };
180
184
  function ProtoGreaterOfEqual(a, b) {
181
185
  return protoLevel[a] >= protoLevel[b];
@@ -1946,6 +1950,8 @@ const noArgInstructionIDs = {
1946
1950
  OPEN_CHEST: true,
1947
1951
  SUB_MUTEZ: true,
1948
1952
  MIN_BLOCK_TIME: true,
1953
+ BYTES: true,
1954
+ NAT: true,
1949
1955
  };
1950
1956
  const instructionIDs = Object.assign({}, noArgInstructionIDs, {
1951
1957
  CONTRACT: true,
@@ -2851,6 +2857,8 @@ const primitives = [
2851
2857
  'Lambda_rec',
2852
2858
  'LAMBDA_REC',
2853
2859
  'TICKET',
2860
+ 'BYTES',
2861
+ 'NAT',
2854
2862
  ];
2855
2863
  const primTags = Object.assign({}, ...primitives.map((v, i) => ({ [v]: i })));
2856
2864
  var Tag;
@@ -4817,8 +4825,14 @@ function functionTypeInternal(inst, stack, ctx) {
4817
4825
  args(0, ['int']);
4818
4826
  return [annotateVar({ prim: 'option', args: [{ prim: 'nat' }] }), ...stack.slice(1)];
4819
4827
  case 'INT':
4820
- args(0, ['nat', 'bls12_381_fr']);
4828
+ args(0, ['nat', 'bls12_381_fr', 'bytes']);
4821
4829
  return [annotateVar({ prim: 'int' }), ...stack.slice(1)];
4830
+ case 'BYTES':
4831
+ args(0, ['nat', 'int']);
4832
+ return [annotateVar({ prim: 'bytes' }), ...stack.slice(1)];
4833
+ case 'NAT':
4834
+ args(0, ['bytes']);
4835
+ return [annotateVar({ prim: 'nat' }), ...stack.slice(1)];
4822
4836
  case 'NEG': {
4823
4837
  const s = args(0, ['nat', 'int', 'bls12_381_g1', 'bls12_381_g2', 'bls12_381_fr'])[0];
4824
4838
  if (s.prim === 'nat' || s.prim === 'int') {
@@ -4828,25 +4842,25 @@ function functionTypeInternal(inst, stack, ctx) {
4828
4842
  }
4829
4843
  case 'LSL':
4830
4844
  case 'LSR':
4831
- args(0, ['nat'], ['nat']);
4845
+ args(0, ['nat', 'bytes'], ['nat', 'bytes']);
4832
4846
  return [annotateVar({ prim: 'nat' }), ...stack.slice(2)];
4833
4847
  case 'OR':
4834
4848
  case 'XOR': {
4835
- const s = args(0, ['nat', 'bool'], ['nat', 'bool']);
4849
+ const s = args(0, ['nat', 'bytes', 'bool'], ['nat', 'bytes', 'bool']);
4836
4850
  if (s[0].prim !== s[1].prim) {
4837
4851
  throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: both arguments must be of the same type: ${s[0].prim}, ${s[1].prim}`);
4838
4852
  }
4839
4853
  return [annotateVar(s[1]), ...stack.slice(2)];
4840
4854
  }
4841
4855
  case 'AND': {
4842
- const s = args(0, ['nat', 'bool', 'int'], ['nat', 'bool']);
4856
+ const s = args(0, ['nat', 'bytes', 'bool', 'int'], ['nat', 'bytes', 'bool']);
4843
4857
  if ((s[0].prim !== 'int' || s[1].prim !== 'nat') && s[0].prim !== s[1].prim) {
4844
4858
  throw new MichelsonInstructionError(instruction, stack, `${instruction.prim}: both arguments must be of the same type: ${s[0].prim}, ${s[1].prim}`);
4845
4859
  }
4846
4860
  return [annotateVar(s[1]), ...stack.slice(2)];
4847
4861
  }
4848
4862
  case 'NOT': {
4849
- const s = args(0, ['nat', 'bool', 'int'])[0];
4863
+ const s = args(0, ['nat', 'bytes', 'bool', 'int'])[0];
4850
4864
  if (s.prim === 'bool') {
4851
4865
  return [annotateVar({ prim: 'bool' }), ...stack.slice(1)];
4852
4866
  }
@@ -5205,7 +5219,7 @@ function functionTypeInternal(inst, stack, ctx) {
5205
5219
  assertTypeAnnotationsValid(instruction.args[0]);
5206
5220
  assertTypeAnnotationsValid(instruction.args[1]);
5207
5221
  const s = [instruction.args[0]];
5208
- if (instruction.prim === "LAMBDA_REC") {
5222
+ if (instruction.prim === 'LAMBDA_REC') {
5209
5223
  s.push({ prim: 'lambda', args: [instruction.args[0], instruction.args[1]] });
5210
5224
  }
5211
5225
  const body = functionTypeInternal(instruction.args[2], s, Object.assign(Object.assign({}, ctx), { contract: undefined }));
@@ -5241,11 +5255,9 @@ function functionTypeInternal(inst, stack, ctx) {
5241
5255
  return [
5242
5256
  annotateVar({
5243
5257
  prim: 'option',
5244
- args: [
5245
- annotate({ prim: 'ticket', args: [s] }, instructionAnn({ t: 1, v: 1 }))
5246
- ]
5258
+ args: [annotate({ prim: 'ticket', args: [s] }, instructionAnn({ t: 1, v: 1 }))],
5247
5259
  }),
5248
- ...stack.slice(2)
5260
+ ...stack.slice(2),
5249
5261
  ];
5250
5262
  }
5251
5263
  }
@@ -5698,8 +5710,8 @@ ${err.data
5698
5710
 
5699
5711
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
5700
5712
  const VERSION = {
5701
- "commitHash": "178bea7c6a3b3c58f23163fcc72e28aa5f08702a",
5702
- "version": "15.1.0"
5713
+ "commitHash": "49a724eb9d4947e2aed19bfa1462fa7ae7848add",
5714
+ "version": "16.0.0"
5703
5715
  };
5704
5716
 
5705
5717
  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 };