Skip to content

Commit

Permalink
Updated dist files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Nov 20, 2019
1 parent 3ab3733 commit 79ef1e9
Show file tree
Hide file tree
Showing 289 changed files with 6,276 additions and 4,681 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,29 @@ Changelog

This change log is managed by `scripts/cmds/update-versions` but may be manually updated.

ethers/v5.0.0-beta.160 (2019-11-20 18:36)
-----------------------------------------

- Updated API in testcases. ([3ab3733](https://github.com/ethers-io/ethers.js/commit/3ab373334c75800f2b20b6639ed8eb1b11e453ef))
- Fixed scrypt import in ESM build. ([b72ef27](https://github.com/ethers-io/ethers.js/commit/b72ef27b2a8f9941fb9d79122ec449fed9d2464d))
- Fixed null apiKey problem for InfuraProvider. ([e518151](https://github.com/ethers-io/ethers.js/commit/e51815150912d10e2734707986b10b37c87d6d12))
- Added support for sighash-style tuple parsing. ([19aaade](https://github.com/ethers-io/ethers.js/commit/19aaade9c62510012cfd50ae487ebd1705a28678))
- Fixed solc imports for cli. ([c35ddaf](https://github.com/ethers-io/ethers.js/commit/c35ddaf646efa25e738fee604585a0a7af45b206))
- Added nonce manager to experimental index. ([8316406](https://github.com/ethers-io/ethers.js/commit/8316406977ea26ca2044d16f7b3bb6ba21ef5b43))
- Removing NodesmithProvider from default provider as it is being discontinued. ([01ca350](https://github.com/ethers-io/ethers.js/commit/01ca35036ca11a47f60890e5cae62e46a00f3da8))
- Moved bare ABI named functions and events from Interface into Contracts to simplify other consumers of Interface. ([da8ca2e](https://github.com/ethers-io/ethers.js/commit/da8ca2e8bc982fc3ea0343bb3c593a485ca1fef0))
- Added support for complex API keys including support for INFURA project secrets. ([#464](https://github.com/ethers-io/ethers.js/issues/464), [#651](https://github.com/ethers-io/ethers.js/issues/651), [#652](https://github.com/ethers-io/ethers.js/issues/652); [1ec5804](https://github.com/ethers-io/ethers.js/commit/1ec5804bd460f6948d4813469fdc7bf739baa6a6))
- Migrated to scrypt-js v3. ([75895fa](https://github.com/ethers-io/ethers.js/commit/75895fa1491e7542c755a102f4e4c190685fd2b6))
- Moved getDefaultProvider to providers package. ([51e4ef2](https://github.com/ethers-io/ethers.js/commit/51e4ef2b45b83a8d82923600a2fac544d70b0807))
- Migrating providers to modern syntax and scoping. ([#634](https://github.com/ethers-io/ethers.js/issues/634); [e1509a6](https://github.com/ethers-io/ethers.js/commit/e1509a6326dd2cb8bf7ed64b82dd3947b768a314))
- Migrating to modern syntax and scoping. ([#634](https://github.com/ethers-io/ethers.js/issues/634); [394c36c](https://github.com/ethers-io/ethers.js/commit/394c36cad43f229a94c72d21f94d1c7982a887a1))
- Added provider property to Web3Provider. ([#641](https://github.com/ethers-io/ethers.js/issues/641); [1d4f90a](https://github.com/ethers-io/ethers.js/commit/1d4f90a958da6364117353850d62535c9702abd2))
- Updated GitHub issue cache. ([494381a](https://github.com/ethers-io/ethers.js/commit/494381a6284cc8ed90bd8002d42a6b6d94dc1200))
- Force deploy receipt to address to be null. ([#573](https://github.com/ethers-io/ethers.js/issues/573); [d9d438a](https://github.com/ethers-io/ethers.js/commit/d9d438a119bb11f8516fc9cf02c534ab3816fcb3))
- Updated experimental NonceManager. ([3d514c8](https://github.com/ethers-io/ethers.js/commit/3d514c8dbb94e1c4ce5754463e683dd9dbe7c0aa))
- Fixed typo in error message. ([28339a9](https://github.com/ethers-io/ethers.js/commit/28339a9c8585392086da159a46df4afb8958915c))
- Added GitHub issue caching. ([fea867a](https://github.com/ethers-io/ethers.js/commit/fea867a206f007a17718396e486883a5e718aa29))

ethers/v5.0.0-beta.159 (2019-10-17 01:08)
-----------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion packages/abi/lib.esm/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const version = "abi/5.0.0-beta.140";
export declare const version = "abi/5.0.0-beta.141";
2 changes: 1 addition & 1 deletion packages/abi/lib.esm/_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "abi/5.0.0-beta.140";
export const version = "abi/5.0.0-beta.141";
5 changes: 4 additions & 1 deletion packages/abi/lib.esm/fragments.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ function parseParamType(param, allowIndexed) {
let c = param[i];
switch (c) {
case "(":
if (!node.state.allowParams) {
if (node.state.allowType && node.type === "") {
node.type = "tuple";
}
else if (!node.state.allowParams) {
throwError(i);
}
node.state.allowType = false;
Expand Down
78 changes: 46 additions & 32 deletions packages/abi/lib.esm/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ export class Interface {
bucket[signature] = fragment;
});
// Add any fragments with a unique name by its name (sans signature parameters)
/*
[this.events, this.functions].forEach((bucket) => {
let count = getNameCount(bucket);
Object.keys(bucket).forEach((signature) => {
let fragment = bucket[signature];
if (count[fragment.name] !== 1) {
logger.warn("duplicate definition - " + fragment.name);
return;
logger.warn("duplicate definition - " + fragment.name);
return;
}
bucket[fragment.name] = fragment;
});
});
*/
// If we do not have a constructor use the default "constructor() payable"
if (!this.deploy) {
defineReadOnly(this, "deploy", ConstructorFragment.from({ type: "constructor" }));
Expand All @@ -98,24 +100,60 @@ export class Interface {
}
getFunction(nameOrSignatureOrSighash) {
if (isHexString(nameOrSignatureOrSighash)) {
return getFragment(nameOrSignatureOrSighash, this.getSighash.bind(this), this.functions);
for (const name in this.functions) {
if (nameOrSignatureOrSighash === this.getSighash(name)) {
return this.functions[name];
}
}
logger.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
}
// It is a bare name, look up the function (will return null if ambiguous)
if (nameOrSignatureOrSighash.indexOf("(") === -1) {
return (this.functions[nameOrSignatureOrSighash.trim()] || null);
const name = nameOrSignatureOrSighash.trim();
const matching = Object.keys(this.functions).filter((f) => (f.split("(" /* fix:) */)[0] === name));
if (matching.length === 0) {
logger.throwArgumentError("no matching function", "name", name);
}
else if (matching.length > 1) {
logger.throwArgumentError("multiple matching functions", "name", name);
}
return this.functions[matching[0]];
}
// Normlize the signature and lookup the function
return this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
}
return result;
}
getEvent(nameOrSignatureOrTopic) {
if (isHexString(nameOrSignatureOrTopic)) {
return getFragment(nameOrSignatureOrTopic, this.getEventTopic.bind(this), this.events);
const topichash = nameOrSignatureOrTopic.toLowerCase();
for (const name in this.events) {
if (topichash === this.getEventTopic(name)) {
return this.events[name];
}
}
logger.throwArgumentError("no matching event", "topichash", topichash);
}
// It is a bare name, look up the function (will return null if ambiguous)
if (nameOrSignatureOrTopic.indexOf("(") === -1) {
return this.events[nameOrSignatureOrTopic];
const name = nameOrSignatureOrTopic.trim();
const matching = Object.keys(this.events).filter((f) => (f.split("(" /* fix:) */)[0] === name));
if (matching.length === 0) {
logger.throwArgumentError("no matching event", "name", name);
}
else if (matching.length > 1) {
logger.throwArgumentError("multiple matching events", "name", name);
}
return this.events[matching[0]];
}
return this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
// Normlize the signature and lookup the function
const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];
if (!result) {
logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
}
return result;
}
getSighash(functionFragment) {
if (typeof (functionFragment) === "string") {
Expand Down Expand Up @@ -335,27 +373,3 @@ export class Interface {
return !!(value && value._isInterface);
}
}
function getFragment(hash, calcFunc, items) {
for (let signature in items) {
if (signature.indexOf("(") === -1) {
continue;
}
let fragment = items[signature];
if (calcFunc(fragment) === hash) {
return fragment;
}
}
return null;
}
function getNameCount(fragments) {
let unique = {};
// Count each name
for (let signature in fragments) {
let name = fragments[signature].name;
if (!unique[name]) {
unique[name] = 0;
}
unique[name]++;
}
return unique;
}
2 changes: 1 addition & 1 deletion packages/abi/lib/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const version = "abi/5.0.0-beta.140";
export declare const version = "abi/5.0.0-beta.141";
2 changes: 1 addition & 1 deletion packages/abi/lib/_version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "abi/5.0.0-beta.140";
exports.version = "abi/5.0.0-beta.141";
5 changes: 4 additions & 1 deletion packages/abi/lib/fragments.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ function parseParamType(param, allowIndexed) {
var c = param[i];
switch (c) {
case "(":
if (!node.state.allowParams) {
if (node.state.allowType && node.type === "") {
node.type = "tuple";
}
else if (!node.state.allowParams) {
throwError(i);
}
node.state.allowType = false;
Expand Down
86 changes: 50 additions & 36 deletions packages/abi/lib/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,19 @@ var Interface = /** @class */ (function () {
bucket[signature] = fragment;
});
// Add any fragments with a unique name by its name (sans signature parameters)
[this.events, this.functions].forEach(function (bucket) {
var count = getNameCount(bucket);
Object.keys(bucket).forEach(function (signature) {
var fragment = bucket[signature];
/*
[this.events, this.functions].forEach((bucket) => {
let count = getNameCount(bucket);
Object.keys(bucket).forEach((signature) => {
let fragment = bucket[signature];
if (count[fragment.name] !== 1) {
logger.warn("duplicate definition - " + fragment.name);
return;
logger.warn("duplicate definition - " + fragment.name);
return;
}
bucket[fragment.name] = fragment;
});
});
*/
// If we do not have a constructor use the default "constructor() payable"
if (!this.deploy) {
properties_1.defineReadOnly(this, "deploy", fragments_1.ConstructorFragment.from({ type: "constructor" }));
Expand All @@ -136,24 +138,60 @@ var Interface = /** @class */ (function () {
};
Interface.prototype.getFunction = function (nameOrSignatureOrSighash) {
if (bytes_1.isHexString(nameOrSignatureOrSighash)) {
return getFragment(nameOrSignatureOrSighash, this.getSighash.bind(this), this.functions);
for (var name_1 in this.functions) {
if (nameOrSignatureOrSighash === this.getSighash(name_1)) {
return this.functions[name_1];
}
}
logger.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
}
// It is a bare name, look up the function (will return null if ambiguous)
if (nameOrSignatureOrSighash.indexOf("(") === -1) {
return (this.functions[nameOrSignatureOrSighash.trim()] || null);
var name_2 = nameOrSignatureOrSighash.trim();
var matching = Object.keys(this.functions).filter(function (f) { return (f.split("(" /* fix:) */)[0] === name_2); });
if (matching.length === 0) {
logger.throwArgumentError("no matching function", "name", name_2);
}
else if (matching.length > 1) {
logger.throwArgumentError("multiple matching functions", "name", name_2);
}
return this.functions[matching[0]];
}
// Normlize the signature and lookup the function
return this.functions[fragments_1.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
var result = this.functions[fragments_1.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
if (!result) {
logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
}
return result;
};
Interface.prototype.getEvent = function (nameOrSignatureOrTopic) {
if (bytes_1.isHexString(nameOrSignatureOrTopic)) {
return getFragment(nameOrSignatureOrTopic, this.getEventTopic.bind(this), this.events);
var topichash = nameOrSignatureOrTopic.toLowerCase();
for (var name_3 in this.events) {
if (topichash === this.getEventTopic(name_3)) {
return this.events[name_3];
}
}
logger.throwArgumentError("no matching event", "topichash", topichash);
}
// It is a bare name, look up the function (will return null if ambiguous)
if (nameOrSignatureOrTopic.indexOf("(") === -1) {
return this.events[nameOrSignatureOrTopic];
var name_4 = nameOrSignatureOrTopic.trim();
var matching = Object.keys(this.events).filter(function (f) { return (f.split("(" /* fix:) */)[0] === name_4); });
if (matching.length === 0) {
logger.throwArgumentError("no matching event", "name", name_4);
}
else if (matching.length > 1) {
logger.throwArgumentError("multiple matching events", "name", name_4);
}
return this.events[matching[0]];
}
// Normlize the signature and lookup the function
var result = this.events[fragments_1.EventFragment.fromString(nameOrSignatureOrTopic).format()];
if (!result) {
logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
}
return this.events[fragments_1.EventFragment.fromString(nameOrSignatureOrTopic).format()];
return result;
};
Interface.prototype.getSighash = function (functionFragment) {
if (typeof (functionFragment) === "string") {
Expand Down Expand Up @@ -376,27 +414,3 @@ var Interface = /** @class */ (function () {
return Interface;
}());
exports.Interface = Interface;
function getFragment(hash, calcFunc, items) {
for (var signature in items) {
if (signature.indexOf("(") === -1) {
continue;
}
var fragment = items[signature];
if (calcFunc(fragment) === hash) {
return fragment;
}
}
return null;
}
function getNameCount(fragments) {
var unique = {};
// Count each name
for (var signature in fragments) {
var name_1 = fragments[signature].name;
if (!unique[name_1]) {
unique[name_1] = 0;
}
unique[name_1]++;
}
return unique;
}
4 changes: 2 additions & 2 deletions packages/abi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethersproject/abi",
"version": "5.0.0-beta.140",
"version": "5.0.0-beta.141",
"description": "Utilities and Classes for parsing, formatting and managing Ethereum ABIs.",
"main": "./lib/index.js",
"scripts": {
Expand Down Expand Up @@ -33,5 +33,5 @@
"module": "./lib.esm/index.js",
"types": "./lib/index.d.ts",
"ethereum": "donations.ethers.eth",
"tarballHash": "0x3e0d6156f8855cd1938962b691562193daeffacdf061949e8a6ad329e8a1e207"
"tarballHash": "0x8ab039f54add63e60520103856dcec83107f301a5d712a92cc6207a0ddbf3ffc"
}
2 changes: 1 addition & 1 deletion packages/abi/src.ts/_version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "abi/5.0.0-beta.140";
export const version = "abi/5.0.0-beta.141";
2 changes: 1 addition & 1 deletion packages/abstract-signer/lib.esm/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const version = "abstract-signer/5.0.0-beta.135";
export declare const version = "abstract-signer/5.0.0-beta.136";
2 changes: 1 addition & 1 deletion packages/abstract-signer/lib.esm/_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "abstract-signer/5.0.0-beta.135";
export const version = "abstract-signer/5.0.0-beta.136";
18 changes: 14 additions & 4 deletions packages/abstract-signer/lib.esm/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
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) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import { defineReadOnly, resolveProperties, shallowCopy } from "@ethersproject/properties";
import { Logger } from "@ethersproject/logger";
import { version } from "./_version";
Expand Down Expand Up @@ -74,12 +83,12 @@ export class Signer {
// - estimateGas
// - populateTransaction (and therefor sendTransaction)
checkTransaction(transaction) {
for (let key in transaction) {
for (const key in transaction) {
if (allowedTransactionKeys.indexOf(key) === -1) {
logger.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
}
}
let tx = shallowCopy(transaction);
const tx = shallowCopy(transaction);
if (tx.from == null) {
tx.from = this.getAddress();
}
Expand All @@ -90,7 +99,8 @@ export class Signer {
// By default called from: (overriding these prevents it)
// - sendTransaction
populateTransaction(transaction) {
return resolveProperties(this.checkTransaction(transaction)).then((tx) => {
return __awaiter(this, void 0, void 0, function* () {
const tx = yield resolveProperties(this.checkTransaction(transaction));
if (tx.to != null) {
tx.to = Promise.resolve(tx.to).then((to) => this.resolveName(to));
}
Expand Down Expand Up @@ -125,7 +135,7 @@ export class Signer {
if (tx.chainId == null) {
tx.chainId = this.getChainId();
}
return resolveProperties(tx);
return yield resolveProperties(tx);
});
}
///////////////////
Expand Down
2 changes: 1 addition & 1 deletion packages/abstract-signer/lib/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const version = "abstract-signer/5.0.0-beta.135";
export declare const version = "abstract-signer/5.0.0-beta.136";
2 changes: 1 addition & 1 deletion packages/abstract-signer/lib/_version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "abstract-signer/5.0.0-beta.135";
exports.version = "abstract-signer/5.0.0-beta.136";
Loading

0 comments on commit 79ef1e9

Please sign in to comment.