Comparing version 4.5.2 to 4.6.0-beta.0
[ | ||
{ | ||
"version": "4.6.0-beta.0", | ||
"changes": [ | ||
{ | ||
"note": "Allow for array types in `RevertError`s.", | ||
"pr": 2075 | ||
}, | ||
{ | ||
"note": "Have Ganache `Error` -> `RevertError` coercion fail if it can't look up the selector.", | ||
"pr": 2109 | ||
}, | ||
{ | ||
"note": "Add `LibFixedMath` `RevertError` types.", | ||
"pr": 2109 | ||
}, | ||
{ | ||
"note": "Add `RawRevertError` `RevertError` type.", | ||
"pr": 2109 | ||
}, | ||
{ | ||
"note": "Make `RevertError.decode()` optionally return a `RawRevertError` if the selector is unknown.", | ||
"pr": 2109 | ||
}, | ||
{ | ||
"note": "Rename `length` field of `AuthorizableRevertErrors.IndexOutOfBoundsError` type to `len`.", | ||
"pr": 2109 | ||
} | ||
], | ||
"timestamp": 1570135330 | ||
}, | ||
{ | ||
"timestamp": 1568744790, | ||
@@ -24,2 +54,6 @@ "version": "4.5.2", | ||
{ | ||
"note": "Add `SafeMathRevertErrors.SafeMathErrorCodes.Uint256DivisionByZero`", | ||
"pr": 2031 | ||
}, | ||
{ | ||
"note": "Updated to include `strictDecode` for decoding method arguments", | ||
@@ -59,2 +93,26 @@ "pr": 2018 | ||
"pr": 1842 | ||
}, | ||
{ | ||
"note": "Add `getChainIdAsync()` to `providerUtils`", | ||
"pr": 1742 | ||
}, | ||
{ | ||
"note": "More robust normalization of `uint256` types in `sign_typed_data_utils`", | ||
"pr": 1742 | ||
}, | ||
{ | ||
"note": "Add `RevertError`, `StringRevertError`, `AnyRevertError` types and associated utilities", | ||
"pr": 1761 | ||
}, | ||
{ | ||
"note": "Update `RevertError` construction to produce a readable `Error` message", | ||
"pr": 1819 | ||
}, | ||
{ | ||
"note": "Add `Error` -> `RevertError` functions", | ||
"pr": 1819 | ||
}, | ||
{ | ||
"note": "Add `toStringTag` symbol to `RevertError`", | ||
"pr": 1885 | ||
} | ||
@@ -61,0 +119,0 @@ ], |
@@ -8,2 +8,11 @@ <!-- | ||
## v4.6.0-beta.0 - _October 3, 2019_ | ||
* Allow for array types in `RevertError`s. (#2075) | ||
* Have Ganache `Error` -> `RevertError` coercion fail if it can't look up the selector. (#2109) | ||
* Add `LibFixedMath` `RevertError` types. (#2109) | ||
* Add `RawRevertError` `RevertError` type. (#2109) | ||
* Make `RevertError.decode()` optionally return a `RawRevertError` if the selector is unknown. (#2109) | ||
* Rename `length` field of `AuthorizableRevertErrors.IndexOutOfBoundsError` type to `len`. (#2109) | ||
## v4.5.2 - _September 17, 2019_ | ||
@@ -19,2 +28,3 @@ | ||
* Add `SafeMathRevertErrors.SafeMathErrorCodes.Uint256DivisionByZero` (#2031) | ||
* Updated to include `strictDecode` for decoding method arguments (#2018) | ||
@@ -34,2 +44,8 @@ * Throw exception when trying to decode beyond boundaries of calldata (#2018) | ||
* Add function deleteNestedProperty (#1842) | ||
* Add `getChainIdAsync()` to `providerUtils` (#1742) | ||
* More robust normalization of `uint256` types in `sign_typed_data_utils` (#1742) | ||
* Add `RevertError`, `StringRevertError`, `AnyRevertError` types and associated utilities (#1761) | ||
* Update `RevertError` construction to produce a readable `Error` message (#1819) | ||
* Add `Error` -> `RevertError` functions (#1819) | ||
* Add `toStringTag` symbol to `RevertError` (#1885) | ||
@@ -36,0 +52,0 @@ ## v4.3.3 - _May 10, 2019_ |
@@ -60,4 +60,4 @@ "use strict"; | ||
}; | ||
PointerCalldataBlock.RAW_DATA_START = new Buffer('<'); | ||
PointerCalldataBlock.RAW_DATA_END = new Buffer('>'); | ||
PointerCalldataBlock.RAW_DATA_START = Buffer.from('<'); | ||
PointerCalldataBlock.RAW_DATA_END = Buffer.from('>'); | ||
PointerCalldataBlock._DEPENDENT_PAYLOAD_SIZE_IN_BYTES = 32; | ||
@@ -64,0 +64,0 @@ PointerCalldataBlock._EMPTY_HEADER_SIZE = 0; |
@@ -49,3 +49,3 @@ "use strict"; | ||
} | ||
return new Buffer(''); | ||
return Buffer.from(''); | ||
}; | ||
@@ -52,0 +52,0 @@ SetCalldataBlock.prototype.getMembers = function () { |
@@ -94,3 +94,3 @@ "use strict"; | ||
done: true, | ||
value: new blob_1.BlobCalldataBlock('', '', '', new Buffer('')), | ||
value: new blob_1.BlobCalldataBlock('', '', '', Buffer.from('')), | ||
}; | ||
@@ -97,0 +97,0 @@ }, |
@@ -37,3 +37,3 @@ "use strict"; | ||
// 1/3 Construct the value | ||
var valueBuf = new Buffer(value); | ||
var valueBuf = Buffer.from(value); | ||
var valueLengthInBytes = valueBuf.byteLength; | ||
@@ -40,0 +40,0 @@ var wordsToStoreValuePadded = Math.ceil(valueLengthInBytes / constants_1.constants.EVM_WORD_WIDTH_IN_BYTES); |
@@ -0,1 +1,8 @@ | ||
export import AuthorizableRevertErrors = require('./authorizable_revert_errors'); | ||
export import FixedMathRevertErrors = require('./fixed_math_revert_errors'); | ||
export import LibAddressArrayRevertErrors = require('./lib_address_array_revert_errors'); | ||
export import LibBytesRevertErrors = require('./lib_bytes_revert_errors'); | ||
export import OwnableRevertErrors = require('./ownable_revert_errors'); | ||
export import ReentrancyGuardRevertErrors = require('./reentrancy_guard_revert_errors'); | ||
export import SafeMathRevertErrors = require('./safe_math_revert_errors'); | ||
export { promisify } from './promisify'; | ||
@@ -18,2 +25,3 @@ export { addressUtils } from './address_utils'; | ||
export { generatePseudoRandom256BitNumber } from './random'; | ||
export { decodeBytesAsRevertError, decodeThrownErrorAsRevertError, coerceThrownErrorAsRevertError, RawRevertError, registerRevertErrorType, RevertError, StringRevertError, AnyRevertError, } from './revert_error'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AuthorizableRevertErrors = require("./authorizable_revert_errors"); | ||
exports.FixedMathRevertErrors = require("./fixed_math_revert_errors"); | ||
exports.LibAddressArrayRevertErrors = require("./lib_address_array_revert_errors"); | ||
exports.LibBytesRevertErrors = require("./lib_bytes_revert_errors"); | ||
exports.OwnableRevertErrors = require("./ownable_revert_errors"); | ||
exports.ReentrancyGuardRevertErrors = require("./reentrancy_guard_revert_errors"); | ||
exports.SafeMathRevertErrors = require("./safe_math_revert_errors"); | ||
var promisify_1 = require("./promisify"); | ||
@@ -34,2 +41,11 @@ exports.promisify = promisify_1.promisify; | ||
exports.generatePseudoRandom256BitNumber = random_1.generatePseudoRandom256BitNumber; | ||
var revert_error_1 = require("./revert_error"); | ||
exports.decodeBytesAsRevertError = revert_error_1.decodeBytesAsRevertError; | ||
exports.decodeThrownErrorAsRevertError = revert_error_1.decodeThrownErrorAsRevertError; | ||
exports.coerceThrownErrorAsRevertError = revert_error_1.coerceThrownErrorAsRevertError; | ||
exports.RawRevertError = revert_error_1.RawRevertError; | ||
exports.registerRevertErrorType = revert_error_1.registerRevertErrorType; | ||
exports.RevertError = revert_error_1.RevertError; | ||
exports.StringRevertError = revert_error_1.StringRevertError; | ||
exports.AnyRevertError = revert_error_1.AnyRevertError; | ||
//# sourceMappingURL=index.js.map |
@@ -15,3 +15,10 @@ import { SupportedProvider, ZeroExProvider } from 'ethereum-types'; | ||
standardizeOrThrow(supportedProvider: SupportedProvider): ZeroExProvider; | ||
/** | ||
* Retrieve the chain ID from a supported provider. | ||
* @param supportedProvider A supported provider instance. | ||
* @return A promise thar resolves to the chain ID of the network the provider | ||
* is connected to. | ||
*/ | ||
getChainIdAsync(supportedProvider: SupportedProvider): Promise<number>; | ||
}; | ||
//# sourceMappingURL=provider_utils.d.ts.map |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -93,3 +128,34 @@ var _ = require("lodash"); | ||
}, | ||
/** | ||
* Retrieve the chain ID from a supported provider. | ||
* @param supportedProvider A supported provider instance. | ||
* @return A promise thar resolves to the chain ID of the network the provider | ||
* is connected to. | ||
*/ | ||
getChainIdAsync: function (supportedProvider) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var provider, RPC_ID_MAX; | ||
return __generator(this, function (_a) { | ||
provider = exports.providerUtils.standardizeOrThrow(supportedProvider); | ||
RPC_ID_MAX = Math.pow(2, 64); | ||
return [2 /*return*/, new Promise(function (accept, reject) { | ||
provider.sendAsync({ | ||
jsonrpc: '2.0', | ||
id: _.random(1, RPC_ID_MAX), | ||
method: 'net_version', | ||
params: [], | ||
}, function (err, result) { | ||
if (!_.isNil(err)) { | ||
reject(err); | ||
} | ||
if (!result) { | ||
throw new Error("Invalid 'net_version' response"); | ||
} | ||
accept(_.toNumber(result.result)); | ||
}); | ||
})]; | ||
}); | ||
}); | ||
}, | ||
}; | ||
//# sourceMappingURL=provider_utils.js.map |
@@ -10,2 +10,16 @@ /// <reference types="node" /> | ||
generateTypedDataHash(typedData: EIP712TypedData): Buffer; | ||
/** | ||
* Generates the EIP712 Typed Data hash for a typed data object without using the domain field. This | ||
* makes hashing easier for non-EIP712 data. | ||
* @param typedData An object that conforms to the EIP712TypedData interface | ||
* @return A Buffer containing the hash of the typed data. | ||
*/ | ||
generateTypedDataHashWithoutDomain(typedData: EIP712TypedData): Buffer; | ||
/** | ||
* Generates the hash of a EIP712 Domain with the default schema | ||
* @param domain An EIP712 domain with the default schema containing a name, version, chain id, | ||
* and verifying address. | ||
* @return A buffer that contains the hash of the domain. | ||
*/ | ||
generateDomainHash(domain: EIP712Object): Buffer; | ||
_findDependencies(primaryType: string, types: EIP712Types, found?: string[]): string[]; | ||
@@ -12,0 +26,0 @@ _encodeType(primaryType: string, types: EIP712Types): string; |
@@ -29,2 +29,30 @@ "use strict"; | ||
}, | ||
/** | ||
* Generates the EIP712 Typed Data hash for a typed data object without using the domain field. This | ||
* makes hashing easier for non-EIP712 data. | ||
* @param typedData An object that conforms to the EIP712TypedData interface | ||
* @return A Buffer containing the hash of the typed data. | ||
*/ | ||
generateTypedDataHashWithoutDomain: function (typedData) { | ||
return exports.signTypedDataUtils._structHash(typedData.primaryType, typedData.message, typedData.types); | ||
}, | ||
/** | ||
* Generates the hash of a EIP712 Domain with the default schema | ||
* @param domain An EIP712 domain with the default schema containing a name, version, chain id, | ||
* and verifying address. | ||
* @return A buffer that contains the hash of the domain. | ||
*/ | ||
generateDomainHash: function (domain) { | ||
return exports.signTypedDataUtils._structHash('EIP712Domain', domain, | ||
// HACK(jalextowle): When we consolidate our testing packages into test-utils, we can use a constant | ||
// to eliminate code duplication. At the moment, there isn't a good way to do that because of cyclic-dependencies. | ||
{ | ||
EIP712Domain: [ | ||
{ name: 'name', type: 'string' }, | ||
{ name: 'version', type: 'string' }, | ||
{ name: 'chainId', type: 'uint256' }, | ||
{ name: 'verifyingContract', type: 'address' }, | ||
], | ||
}); | ||
}, | ||
_findDependencies: function (primaryType, types, found) { | ||
@@ -130,4 +158,10 @@ if (found === void 0) { found = []; } | ||
_normalizeValue: function (type, value) { | ||
var normalizedValue = type === 'uint256' && configured_bignumber_1.BigNumber.isBigNumber(value) ? value.toString() : value; | ||
return normalizedValue; | ||
var STRING_BASE = 10; | ||
if (type === 'uint256') { | ||
if (configured_bignumber_1.BigNumber.isBigNumber(value)) { | ||
return value.toString(STRING_BASE); | ||
} | ||
return new configured_bignumber_1.BigNumber(value).toString(STRING_BASE); | ||
} | ||
return value; | ||
}, | ||
@@ -134,0 +168,0 @@ _typeHash: function (primaryType, types) { |
{ | ||
"name": "@0x/utils", | ||
"version": "4.5.2", | ||
"version": "4.6.0-beta.0", | ||
"engines": { | ||
@@ -48,4 +48,4 @@ "node": ">=6.12" | ||
"dependencies": { | ||
"@0x/types": "^2.4.3", | ||
"@0x/typescript-typings": "^4.3.0", | ||
"@0x/types": "^2.5.0-beta.0", | ||
"@0x/typescript-typings": "^4.4.0-beta.0", | ||
"@types/node": "*", | ||
@@ -56,3 +56,3 @@ "abortcontroller-polyfill": "^1.1.9", | ||
"detect-node": "2.0.3", | ||
"ethereum-types": "^2.1.6", | ||
"ethereum-types": "^2.2.0-beta.0", | ||
"ethereumjs-util": "^5.1.1", | ||
@@ -67,3 +67,3 @@ "ethers": "~4.0.4", | ||
}, | ||
"gitHead": "ec92cea5982375fa2fa7ba8445b5e8af589b75bd" | ||
"gitHead": "c60d1e50c53f4763f7c5ac99f8d3c7860c15a2b7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
434714
225
6563
2
+ Added@0x/types@2.5.0-beta.3(transitive)
+ Added@0x/typescript-typings@4.4.0-beta.2(transitive)
+ Addedbignumber.js@9.0.2(transitive)
+ Addedethereum-types@2.2.0-beta.2(transitive)
- Removed@0x/types@2.4.3(transitive)
- Removed@0x/typescript-typings@4.3.0(transitive)
- Removedethereum-types@2.1.6(transitive)
Updated@0x/types@^2.5.0-beta.0
Updatedethereum-types@^2.2.0-beta.0