@mavrykdynamics/taquito-local-forging
Version:
Provide local forging functionality to be with taquito
180 lines (179 loc) • 7.1 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.InvalidDalCommitmentError = exports.InvalidSmartRollupCommitmentHashError = exports.InvalidSmartRollupAddressError = exports.DecodePvmKindError = exports.UnsupportedPvmKindError = exports.UnsupportedOperationError = exports.OperationEncodingError = exports.OperationDecodingError = exports.UnexpectedMichelsonValueError = exports.DecodeBallotValueError = exports.InvalidBallotValueError = exports.OversizedEntryPointError = exports.InvalidOperationSchemaError = void 0;
const taquito_core_1 = require("@mavrykdynamics/taquito-core");
const constants_1 = require("./constants");
/**
* @category Error
* @description Error that indicates an invalid operation content being passed or used
*/ class InvalidOperationSchemaError extends taquito_core_1.ParameterValidationError {
constructor(operation, errorDetail) {
super();
this.operation = operation;
this.errorDetail = errorDetail;
this.name = 'InvalidOperationSchemaError';
this.message = `Invalid operation content recevied`;
errorDetail ? (this.message += ` ${errorDetail}.`) : '';
}
}
exports.InvalidOperationSchemaError = InvalidOperationSchemaError;
/**
* @category Error
* @description Error that indicates an entrypoint name exceeding maximum length
*/
class OversizedEntryPointError extends taquito_core_1.ParameterValidationError {
constructor(entrypoint) {
super();
this.entrypoint = entrypoint;
this.name = 'OversizedEntryPointError';
this.message = `Invalid entrypoint length "${entrypoint.length}", maximum length is "${constants_1.ENTRYPOINT_MAX_LENGTH}".`;
}
}
exports.OversizedEntryPointError = OversizedEntryPointError;
/**
* @category Error
* @description Error that indicates an invalid ballot value being used
*/
class InvalidBallotValueError extends taquito_core_1.ParameterValidationError {
constructor(ballotValue) {
super();
this.ballotValue = ballotValue;
this.name = 'InvalidBallotValueError';
this.message = `Invalid ballot value "${ballotValue}" expecting one of the following: "yay", "nay", "pass".`;
}
}
exports.InvalidBallotValueError = InvalidBallotValueError;
/**
* @category Error
* @description Error that indicates a failure when trying to decode ballot value
*/
class DecodeBallotValueError extends taquito_core_1.ParameterValidationError {
constructor(ballotValue) {
super();
this.ballotValue = ballotValue;
this.name = 'DecodeBallotValueError';
this.message = `Invalid ballot value "${ballotValue}", cannot be decoded.`;
}
}
exports.DecodeBallotValueError = DecodeBallotValueError;
/**
* @category Error
* @description Error that indicates unexpected Michelson Value being passed or used
*/
class UnexpectedMichelsonValueError extends taquito_core_1.ParameterValidationError {
constructor(value) {
super();
this.value = value;
this.name = 'UnexpectedMichelsonValueError';
this.message = `Invalid Michelson value "${value}", unalbe to encode.`;
}
}
exports.UnexpectedMichelsonValueError = UnexpectedMichelsonValueError;
/**
* @category Error
* @description Error that indicates a failure when trying to decode an operation
*/
class OperationDecodingError extends taquito_core_1.ParameterValidationError {
constructor(message) {
super();
this.message = message;
this.name = 'OperationDecodingError';
}
}
exports.OperationDecodingError = OperationDecodingError;
/**
* @category Error
* @description Error that indicates a failure when trying to encode an operation
*/
class OperationEncodingError extends taquito_core_1.ParameterValidationError {
constructor(message) {
super();
this.message = message;
this.name = 'OperationEncodingError';
}
}
exports.OperationEncodingError = OperationEncodingError;
/**
* @category Error
* @description Error that indicates an unsupported operation being passed or used
*/
class UnsupportedOperationError extends taquito_core_1.ParameterValidationError {
constructor(op) {
super();
this.op = op;
this.name = 'UnsupportedOperationError';
this.message = `Unsupported operation "${op}", can submit an issue on our github for feature request.`;
}
}
exports.UnsupportedOperationError = UnsupportedOperationError;
/**
* @cateogry Error
* @description Error that indicates an unsupported pvm being passed or used
*/
class UnsupportedPvmKindError extends taquito_core_1.ParameterValidationError {
constructor(pvm) {
super();
this.pvm = pvm;
this.name = 'UnsupportedPvmKindError';
this.message = `Invalid Pvm kind "${pvm}" expecting either "arith" or "wasm_2_0_0".`;
}
}
exports.UnsupportedPvmKindError = UnsupportedPvmKindError;
/**
* @category Error
* @description Error that indicates an unsupported pvm to decode
*/
class DecodePvmKindError extends taquito_core_1.ParameterValidationError {
constructor(pvm) {
super();
this.pvm = pvm;
this.name = 'DecodePvmKindError';
this.message = `Invalid Pvm kind "${pvm}", cannot be decoded.`;
}
}
exports.DecodePvmKindError = DecodePvmKindError;
/**
* @category Error
* @description Error that indicates an invalid Smart Rollup Address (sr1)
*/
class InvalidSmartRollupAddressError extends taquito_core_1.ParameterValidationError {
constructor(address, errorDetail) {
super();
this.address = address;
this.errorDetail = errorDetail;
this.name = 'InvalidSmartRollupAddress';
this.message = `Invalid smart rollup address "${address}"`;
errorDetail ? (this.message += ` ${errorDetail}.`) : '';
}
}
exports.InvalidSmartRollupAddressError = InvalidSmartRollupAddressError;
/**
* @category Error
* @description Error that indicates an invalid Smart Rollup commitment hash (src1)
*/
class InvalidSmartRollupCommitmentHashError extends taquito_core_1.ParameterValidationError {
constructor(hash, errorDetail) {
super();
this.hash = hash;
this.errorDetail = errorDetail;
this.name = 'InvalidSmartRollupCommitmentHashError';
this.message = `Invalid smart rollup commitment hash "${hash}"`;
errorDetail ? (this.message += ` ${errorDetail}.`) : '';
}
}
exports.InvalidSmartRollupCommitmentHashError = InvalidSmartRollupCommitmentHashError;
/**
* @category Error
* @description Error that indicates an invalid dal commitment (sh)
*/
class InvalidDalCommitmentError extends taquito_core_1.ParameterValidationError {
constructor(commitment, errorDetail) {
super();
this.commitment = commitment;
this.errorDetail = errorDetail;
this.name = 'InvalidDalCommitmentError';
this.message = `Invalid dal commitment "${commitment}"`;
errorDetail ? (this.message += ` ${errorDetail}.`) : '';
}
}
exports.InvalidDalCommitmentError = InvalidDalCommitmentError;