Skip to content

Commit f996ec0

Browse files
committed
Updated dist files.
1 parent c76e01e commit f996ec0

File tree

14 files changed

+114
-14
lines changed

14 files changed

+114
-14
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
ethers/v4.0.42 (2020-01-03 18:35)
5+
---------------------------------
6+
7+
- Properly handle errors in the IpcProvider ([#695](https://github.com/ethers-io/ethers.js/issues/695); [c76e01e](https://github.com/ethers-io/ethers.js/commit/c76e01e61fd52692f58c516842f7ed3b252b0f83))
8+
- Added utility function to compute CREATE2 addresses ([#697](https://github.com/ethers-io/ethers.js/issues/697); [f8087ae](https://github.com/ethers-io/ethers.js/commit/f8087ae39ce7631425b6b4763347a4f9618f9730))
9+
410
ethers/v4.0.41 (2019-12-21 01:05)
511
---------------------------------
612

_version.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare const version = "4.0.41";
1+
export declare const version = "4.0.42";

_version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
3-
exports.version = "4.0.41";
3+
exports.version = "4.0.42";

dist/ethers.js

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethers = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
22
"use strict";
33
Object.defineProperty(exports, "__esModule", { value: true });
4-
exports.version = "4.0.41";
4+
exports.version = "4.0.42";
55

66
},{}],2:[function(require,module,exports){
77
"use strict";
@@ -13460,6 +13460,41 @@ function getContractAddress(transaction) {
1346013460
])).substring(26));
1346113461
}
1346213462
exports.getContractAddress = getContractAddress;
13463+
// See: https://eips.ethereum.org/EIPS/eip-1014
13464+
function getCreate2Address(options) {
13465+
var initCodeHash = options.initCodeHash;
13466+
if (options.initCode) {
13467+
if (initCodeHash) {
13468+
if (keccak256_1.keccak256(options.initCode) !== initCodeHash) {
13469+
errors.throwError("initCode/initCodeHash mismatch", errors.INVALID_ARGUMENT, {
13470+
arg: "options", value: options
13471+
});
13472+
}
13473+
}
13474+
else {
13475+
initCodeHash = keccak256_1.keccak256(options.initCode);
13476+
}
13477+
}
13478+
if (!initCodeHash) {
13479+
errors.throwError("missing initCode or initCodeHash", errors.INVALID_ARGUMENT, {
13480+
arg: "options", value: options
13481+
});
13482+
}
13483+
var from = getAddress(options.from);
13484+
var salt = bytes_1.arrayify(options.salt);
13485+
if (salt.length !== 32) {
13486+
errors.throwError("invalid salt", errors.INVALID_ARGUMENT, {
13487+
arg: "options", value: options
13488+
});
13489+
}
13490+
return getAddress("0x" + keccak256_1.keccak256(bytes_1.concat([
13491+
"0xff",
13492+
from,
13493+
salt,
13494+
initCodeHash
13495+
])).substring(26));
13496+
}
13497+
exports.getCreate2Address = getCreate2Address;
1346313498

1346413499
},{"../errors":5,"./bytes":64,"./keccak256":71,"./rlp":76,"bn.js":9}],61:[function(require,module,exports){
1346513500
'use strict';
@@ -14505,6 +14540,7 @@ exports.parseParamType = abi_coder_1.parseParamType;
1450514540
var address_1 = require("./address");
1450614541
exports.getAddress = address_1.getAddress;
1450714542
exports.getContractAddress = address_1.getContractAddress;
14543+
exports.getCreate2Address = address_1.getCreate2Address;
1450814544
exports.getIcapAddress = address_1.getIcapAddress;
1450914545
var base64 = __importStar(require("./base64"));
1451014546
exports.base64 = base64;

dist/ethers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ethers.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ethers.types.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ declare module 'ethers/providers' {
211211

212212
declare module 'ethers/utils' {
213213
import { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from 'ethers/utils/abi-coder';
214-
import { getAddress, getContractAddress, getIcapAddress } from 'ethers/utils/address';
214+
import { getAddress, getContractAddress, getCreate2Address, getIcapAddress } from 'ethers/utils/address';
215215
import * as base64 from 'ethers/utils/base64';
216216
import { BigNumber, bigNumberify } from 'ethers/utils/bignumber';
217217
import { arrayify, concat, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, isHexString, joinSignature, padZeros, splitSignature, stripZeros } from 'ethers/utils/bytes';
@@ -244,7 +244,7 @@ declare module 'ethers/utils' {
244244
import { ConnectionInfo, OnceBlockable, PollOptions } from 'ethers/utils/web';
245245
import { EncryptOptions, ProgressCallback } from 'ethers/utils/secret-storage';
246246
import { Wordlist } from 'ethers/utils/wordlist';
247-
export { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType, RLP, fetchJson, getNetwork, checkProperties, deepCopy, defineReadOnly, resolveProperties, shallowCopy, arrayify, concat, padZeros, stripZeros, HDNode, SigningKey, Interface, base64, BigNumber, bigNumberify, hexlify, isHexString, hexStripZeros, hexZeroPad, hexDataLength, hexDataSlice, toUtf8Bytes, toUtf8String, formatBytes32String, parseBytes32String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, populateTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, computePublicKey, recoverAddress, recoverPublicKey, verifyMessage, poll, SupportedAlgorithms, UnicodeNormalizationForm, CoerceFunc, EventFragment, FunctionFragment, ParamType, BigNumberish, Arrayish, Hexable, Signature, Indexed, DeployDescription, EventDescription, FunctionDescription, LogDescription, TransactionDescription, Network, Networkish, Transaction, UnsignedTransaction, ConnectionInfo, OnceBlockable, PollOptions, EncryptOptions, ProgressCallback, Wordlist, };
247+
export { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType, RLP, fetchJson, getNetwork, checkProperties, deepCopy, defineReadOnly, resolveProperties, shallowCopy, arrayify, concat, padZeros, stripZeros, HDNode, SigningKey, Interface, base64, BigNumber, bigNumberify, hexlify, isHexString, hexStripZeros, hexZeroPad, hexDataLength, hexDataSlice, toUtf8Bytes, toUtf8String, formatBytes32String, parseBytes32String, hashMessage, namehash, id, getAddress, getIcapAddress, getContractAddress, getCreate2Address, formatEther, parseEther, formatUnits, parseUnits, commify, keccak256, sha256, randomBytes, solidityPack, solidityKeccak256, soliditySha256, splitSignature, joinSignature, parseTransaction, populateTransaction, serializeTransaction, getJsonWalletAddress, computeAddress, computePublicKey, recoverAddress, recoverPublicKey, verifyMessage, poll, SupportedAlgorithms, UnicodeNormalizationForm, CoerceFunc, EventFragment, FunctionFragment, ParamType, BigNumberish, Arrayish, Hexable, Signature, Indexed, DeployDescription, EventDescription, FunctionDescription, LogDescription, TransactionDescription, Network, Networkish, Transaction, UnsignedTransaction, ConnectionInfo, OnceBlockable, PollOptions, EncryptOptions, ProgressCallback, Wordlist, };
248248
}
249249

250250
declare module 'ethers/wordlists' {
@@ -266,7 +266,7 @@ declare module 'ethers/utils/shims' {
266266
}
267267

268268
declare module 'ethers/_version' {
269-
export const version = "4.0.41";
269+
export const version = "4.0.42";
270270
}
271271

272272
declare module 'ethers/utils/bignumber' {
@@ -898,6 +898,13 @@ declare module 'ethers/utils/address' {
898898
from: string;
899899
nonce: Arrayish | BigNumber | number;
900900
}): string;
901+
export type Create2Options = {
902+
from: string;
903+
salt: Arrayish;
904+
initCode?: Arrayish;
905+
initCodeHash?: Arrayish;
906+
};
907+
export function getCreate2Address(options: Create2Options): string;
901908
}
902909

903910
declare module 'ethers/utils/base64' {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ethers",
3-
"version": "4.0.41",
3+
"version": "4.0.42",
44
"description": "Ethereum wallet library.",
55
"main": "./index.js",
66
"types": "./index.d.ts",

providers/ipc-provider.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,16 @@ var IpcProvider = /** @class */ (function (_super) {
5959
});
6060
stream.on("end", function () {
6161
try {
62-
resolve(JSON.parse(response.toString('utf8')).result);
63-
// @TODO: Better pull apart the error
62+
var payload_1 = JSON.parse(response.toString('utf8'));
63+
if (payload_1.error) {
64+
var error = new Error(payload_1.error.message);
65+
error.code = payload_1.error.code;
66+
error.data = payload_1.error.data;
67+
reject(error);
68+
}
69+
else {
70+
resolve(payload_1.result);
71+
}
6472
stream.destroy();
6573
}
6674
catch (error) {

src.ts/_version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = "4.0.41";
1+
export const version = "4.0.42";

0 commit comments

Comments
 (0)