Remove unused dist files.
This commit is contained in:
parent
c8a75ab01d
commit
1ca203ca38
11
utils/constants.d.ts
vendored
11
utils/constants.d.ts
vendored
@ -1,11 +0,0 @@
|
|||||||
import { BigNumber } from './bignumber';
|
|
||||||
declare const AddressZero = "0x0000000000000000000000000000000000000000";
|
|
||||||
declare const HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
||||||
declare const EtherSymbol = "\u039E";
|
|
||||||
declare const NegativeOne: BigNumber;
|
|
||||||
declare const Zero: BigNumber;
|
|
||||||
declare const One: BigNumber;
|
|
||||||
declare const Two: BigNumber;
|
|
||||||
declare const WeiPerEther: BigNumber;
|
|
||||||
declare const MaxUint256: BigNumber;
|
|
||||||
export { AddressZero, HashZero, EtherSymbol, NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256 };
|
|
@ -1,24 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
var bignumber_1 = require("./bignumber");
|
|
||||||
var AddressZero = '0x0000000000000000000000000000000000000000';
|
|
||||||
exports.AddressZero = AddressZero;
|
|
||||||
var HashZero = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
|
||||||
exports.HashZero = HashZero;
|
|
||||||
// NFKD (decomposed)
|
|
||||||
//const EtherSymbol = '\uD835\uDF63';
|
|
||||||
// NFKC (composed)
|
|
||||||
var EtherSymbol = '\u039e';
|
|
||||||
exports.EtherSymbol = EtherSymbol;
|
|
||||||
var NegativeOne = bignumber_1.bigNumberify(-1);
|
|
||||||
exports.NegativeOne = NegativeOne;
|
|
||||||
var Zero = bignumber_1.bigNumberify(0);
|
|
||||||
exports.Zero = Zero;
|
|
||||||
var One = bignumber_1.bigNumberify(1);
|
|
||||||
exports.One = One;
|
|
||||||
var Two = bignumber_1.bigNumberify(2);
|
|
||||||
exports.Two = Two;
|
|
||||||
var WeiPerEther = bignumber_1.bigNumberify('1000000000000000000');
|
|
||||||
exports.WeiPerEther = WeiPerEther;
|
|
||||||
var MaxUint256 = bignumber_1.bigNumberify('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
|
|
||||||
exports.MaxUint256 = MaxUint256;
|
|
16
utils/errors.d.ts
vendored
16
utils/errors.d.ts
vendored
@ -1,16 +0,0 @@
|
|||||||
export declare const UNKNOWN_ERROR = "UNKNOWN_ERROR";
|
|
||||||
export declare const NOT_IMPLEMENTED = "NOT_IMPLEMENTED";
|
|
||||||
export declare const MISSING_NEW = "MISSING_NEW";
|
|
||||||
export declare const CALL_EXCEPTION = "CALL_EXCEPTION";
|
|
||||||
export declare const INVALID_ARGUMENT = "INVALID_ARGUMENT";
|
|
||||||
export declare const MISSING_ARGUMENT = "MISSING_ARGUMENT";
|
|
||||||
export declare const UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT";
|
|
||||||
export declare const NUMERIC_FAULT = "NUMERIC_FAULT";
|
|
||||||
export declare const INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS";
|
|
||||||
export declare const NONCE_EXPIRED = "NONCE_EXPIRED";
|
|
||||||
export declare const REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED";
|
|
||||||
export declare const UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION";
|
|
||||||
export declare function throwError(message: string, code: string, params: any): never;
|
|
||||||
export declare function checkNew(self: any, kind: any): void;
|
|
||||||
export declare function checkArgumentCount(count: number, expectedCount: number, suffix?: string): void;
|
|
||||||
export declare function setCensorship(censorship: boolean, permanent?: boolean): void;
|
|
108
utils/errors.js
108
utils/errors.js
@ -1,108 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
// Unknown Error
|
|
||||||
exports.UNKNOWN_ERROR = 'UNKNOWN_ERROR';
|
|
||||||
// Not implemented
|
|
||||||
exports.NOT_IMPLEMENTED = 'NOT_IMPLEMENTED';
|
|
||||||
// Missing new operator to an object
|
|
||||||
// - name: The name of the class
|
|
||||||
exports.MISSING_NEW = 'MISSING_NEW';
|
|
||||||
// Call exception
|
|
||||||
// - transaction: the transaction
|
|
||||||
// - address?: the contract address
|
|
||||||
// - args?: The arguments passed into the function
|
|
||||||
// - method?: The Solidity method signature
|
|
||||||
// - errorSignature?: The EIP848 error signature
|
|
||||||
// - errorArgs?: The EIP848 error parameters
|
|
||||||
// - reason: The reason (only for EIP848 "Error(string)")
|
|
||||||
exports.CALL_EXCEPTION = 'CALL_EXCEPTION';
|
|
||||||
// Invalid argument (e.g. value is incompatible with type) to a function:
|
|
||||||
// - arg: The argument name that was invalid
|
|
||||||
// - value: The value of the argument
|
|
||||||
exports.INVALID_ARGUMENT = 'INVALID_ARGUMENT';
|
|
||||||
// Missing argument to a function:
|
|
||||||
// - count: The number of arguments received
|
|
||||||
// - expectedCount: The number of arguments expected
|
|
||||||
exports.MISSING_ARGUMENT = 'MISSING_ARGUMENT';
|
|
||||||
// Too many arguments
|
|
||||||
// - count: The number of arguments received
|
|
||||||
// - expectedCount: The number of arguments expected
|
|
||||||
exports.UNEXPECTED_ARGUMENT = 'UNEXPECTED_ARGUMENT';
|
|
||||||
// Numeric Fault
|
|
||||||
// - operation: the operation being executed
|
|
||||||
// - fault: the reason this faulted
|
|
||||||
exports.NUMERIC_FAULT = 'NUMERIC_FAULT';
|
|
||||||
// Insufficien funds (< value + gasLimit * gasPrice)
|
|
||||||
// - transaction: the transaction attempted
|
|
||||||
exports.INSUFFICIENT_FUNDS = 'INSUFFICIENT_FUNDS';
|
|
||||||
// Nonce has already been used
|
|
||||||
// - transaction: the transaction attempted
|
|
||||||
exports.NONCE_EXPIRED = 'NONCE_EXPIRED';
|
|
||||||
// The replacement fee for the transaction is too low
|
|
||||||
// - transaction: the transaction attempted
|
|
||||||
exports.REPLACEMENT_UNDERPRICED = 'REPLACEMENT_UNDERPRICED';
|
|
||||||
// Unsupported operation
|
|
||||||
// - operation
|
|
||||||
exports.UNSUPPORTED_OPERATION = 'UNSUPPORTED_OPERATION';
|
|
||||||
var _permanentCensorErrors = false;
|
|
||||||
var _censorErrors = false;
|
|
||||||
// @TODO: Enum
|
|
||||||
function throwError(message, code, params) {
|
|
||||||
if (_censorErrors) {
|
|
||||||
throw new Error('unknown error');
|
|
||||||
}
|
|
||||||
if (!code) {
|
|
||||||
code = exports.UNKNOWN_ERROR;
|
|
||||||
}
|
|
||||||
if (!params) {
|
|
||||||
params = {};
|
|
||||||
}
|
|
||||||
var messageDetails = [];
|
|
||||||
Object.keys(params).forEach(function (key) {
|
|
||||||
try {
|
|
||||||
messageDetails.push(key + '=' + JSON.stringify(params[key]));
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
messageDetails.push(key + '=' + JSON.stringify(params[key].toString()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
var reason = message;
|
|
||||||
if (messageDetails.length) {
|
|
||||||
message += ' (' + messageDetails.join(', ') + ')';
|
|
||||||
}
|
|
||||||
// @TODO: Any??
|
|
||||||
var error = new Error(message);
|
|
||||||
error.reason = reason;
|
|
||||||
error.code = code;
|
|
||||||
Object.keys(params).forEach(function (key) {
|
|
||||||
error[key] = params[key];
|
|
||||||
});
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
exports.throwError = throwError;
|
|
||||||
function checkNew(self, kind) {
|
|
||||||
if (!(self instanceof kind)) {
|
|
||||||
throwError('missing new', exports.MISSING_NEW, { name: kind.name });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.checkNew = checkNew;
|
|
||||||
function checkArgumentCount(count, expectedCount, suffix) {
|
|
||||||
if (!suffix) {
|
|
||||||
suffix = '';
|
|
||||||
}
|
|
||||||
if (count < expectedCount) {
|
|
||||||
throwError('missing argument' + suffix, exports.MISSING_ARGUMENT, { count: count, expectedCount: expectedCount });
|
|
||||||
}
|
|
||||||
if (count > expectedCount) {
|
|
||||||
throwError('too many arguments' + suffix, exports.UNEXPECTED_ARGUMENT, { count: count, expectedCount: expectedCount });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.checkArgumentCount = checkArgumentCount;
|
|
||||||
function setCensorship(censorship, permanent) {
|
|
||||||
if (_permanentCensorErrors) {
|
|
||||||
throwError('error censorship permanent', exports.UNSUPPORTED_OPERATION, { operation: 'setCersorship' });
|
|
||||||
}
|
|
||||||
_censorErrors = !!censorship;
|
|
||||||
_permanentCensorErrors = !!permanent;
|
|
||||||
}
|
|
||||||
exports.setCensorship = setCensorship;
|
|
Loading…
Reference in New Issue
Block a user