@mavrykdynamics/taquito-michel-codec
Version:
Michelson parser/validator/formatter
91 lines (90 loc) • 3.14 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HexParseError = exports.LongIntegerError = exports.MavrykIdEncodeError = exports.InvalidEntrypointError = exports.InvalidDataExpressionError = exports.InvalidTypeExpressionError = exports.InvalidMichelsonError = void 0;
const taquito_core_1 = require("@mavrykdynamics/taquito-core");
/**
* @category Error
* @description Error that indicates an invalid Michelson being passed or used
*/
class InvalidMichelsonError extends taquito_core_1.ParameterValidationError {
constructor(message) {
super();
this.message = message;
this.name = 'InvalidMichelsonError';
}
}
exports.InvalidMichelsonError = InvalidMichelsonError;
/**
* @category Error
* @description Error that indicates an invalid type expression being passed or used
*/
class InvalidTypeExpressionError extends taquito_core_1.ParameterValidationError {
constructor(message) {
super();
this.message = message;
this.name = 'InvalidTypeExpressionError';
}
}
exports.InvalidTypeExpressionError = InvalidTypeExpressionError;
/**
* @category Error
* @description Error that indicates an invalid data expression being passed or used
*/
class InvalidDataExpressionError extends taquito_core_1.ParameterValidationError {
constructor(message) {
super();
this.message = message;
this.name = 'InvalidDataExpressionError';
}
}
exports.InvalidDataExpressionError = InvalidDataExpressionError;
/**
* @category Error
* @description Error that indicates an invalid contract entrypoint being referenced or passed
*/
class InvalidEntrypointError extends taquito_core_1.ParameterValidationError {
constructor(entrypoint) {
super();
this.entrypoint = entrypoint;
this.name = 'InvalidEntrypointError';
this.message = `Contract has no entrypoint named: "${entrypoint}"`;
}
}
exports.InvalidEntrypointError = InvalidEntrypointError;
/**
* @category Error
* @description Error that indicates a failure happening when trying to encode Mavryk ID
*/
class MavrykIdEncodeError extends taquito_core_1.ParameterValidationError {
constructor(message) {
super();
this.message = message;
this.name = 'MavrykIdEncodeError';
}
}
exports.MavrykIdEncodeError = MavrykIdEncodeError;
/**
* @category Error
* @description Error that indicates a general error happening when trying to create a LongInteger
*/
class LongIntegerError extends taquito_core_1.TaquitoError {
constructor(message) {
super();
this.message = message;
this.name = 'LongIntegerError';
}
}
exports.LongIntegerError = LongIntegerError;
/**
* @category Error
* @description Error that indicates a failure occurring when trying to parse a hex byte
*/
class HexParseError extends taquito_core_1.TaquitoError {
constructor(hexByte) {
super();
this.hexByte = hexByte;
this.name = 'HexParseError';
this.message = `Unable to parse hex byte "${hexByte}"`;
}
}
exports.HexParseError = HexParseError;