Skip to content

Commit

Permalink
Updated dist files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jan 9, 2020
1 parent c04f9a7 commit 074eb4b
Show file tree
Hide file tree
Showing 33 changed files with 156 additions and 99 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Changelog

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

ethers/v5.0.0-beta.165 (2020-01-09 03:31)
-----------------------------------------

- Fixed require resolution for CLI scripts. ([c04f9a7](https://github.com/ethers-io/ethers.js/commit/c04f9a7fff727bb04a4aa3a0fa05fd5cd8e795a6))
- Added new URLs for default ETC (and ETC testnets) providers. ([#351](https://github.com/ethers-io/ethers.js/issues/351); [3c184ac](https://github.com/ethers-io/ethers.js/commit/3c184ace21aafbb27f4d44cce1bb738af899d59f))

ethers/v5.0.0-beta.164 (2020-01-07 19:57)
-----------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib.esm/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const version = "cli/5.0.0-beta.147";
export declare const version = "cli/5.0.0-beta.148";
2 changes: 1 addition & 1 deletion packages/cli/lib.esm/_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "cli/5.0.0-beta.147";
export const version = "cli/5.0.0-beta.148";
18 changes: 13 additions & 5 deletions packages/cli/lib.esm/bin/ethers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
import fs from "fs";
import _module from "module";
import { dirname, resolve } from "path";
import REPL from "repl";
import util from "util";
import vm from "vm";
import { ethers } from "ethers";
import { CLI, dump, Plugin } from "../cli";
import { getPassword, getProgressBar } from "../prompt";
import { compile } from "../solc";
function setupContext(context, plugin) {
function setupContext(path, context, plugin) {
context.provider = plugin.provider;
context.accounts = plugin.accounts;
if (!context.__filename) {
context.__filename = path;
}
if (!context.__dirname) {
context.__dirname = dirname(path);
}
if (!context.console) {
context.console = console;
}
if (!context.require) {
context.require = require;
context.require = _module.createRequireFromPath(path);
}
if (!context.process) {
context.process = process;
Expand Down Expand Up @@ -119,7 +127,7 @@ class SandboxPlugin extends Plugin {
prompt: (this.provider ? this.network.name : "no-network") + "> ",
writer: promiseWriter
});
setupContext(repl.context, this);
setupContext(resolve(process.cwd(), "./sandbox.js"), repl.context, this);
return new Promise((resolve) => {
repl.on("exit", function () {
console.log("");
Expand Down Expand Up @@ -471,7 +479,7 @@ class EvalPlugin extends Plugin {
run() {
return __awaiter(this, void 0, void 0, function* () {
let contextObject = {};
setupContext(contextObject, this);
setupContext(resolve(process.cwd(), "./sandbox.js"), contextObject, this);
let context = vm.createContext(contextObject);
let script = new vm.Script(this.code, { filename: "-" });
let result = script.runInContext(context);
Expand Down Expand Up @@ -505,7 +513,7 @@ class RunPlugin extends Plugin {
run() {
return __awaiter(this, void 0, void 0, function* () {
let contextObject = {};
setupContext(contextObject, this);
setupContext(resolve(this.filename), contextObject, this);
let context = vm.createContext(contextObject);
let script = new vm.Script(fs.readFileSync(this.filename).toString(), { filename: this.filename });
let result = script.runInContext(context);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib.esm/cli.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export declare abstract class Plugin {
constructor();
static getHelp(): Help;
static getOptionHelp(): Array<Help>;
prepareOptions(argParser: ArgParser): Promise<void>;
prepareOptions(argParser: ArgParser, verifyOnly?: boolean): Promise<void>;
prepareArgs(args: Array<string>): Promise<void>;
run(): Promise<void>;
getAddress(addressOrName: string, message?: string, allowZero?: boolean): Promise<string>;
Expand Down
21 changes: 14 additions & 7 deletions packages/cli/lib.esm/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ function loadAccount(arg, plugin, preventFile) {
return __awaiter(this, void 0, void 0, function* () {
// Secure entry; use prompt with mask
if (arg === "-") {
let content = yield getPassword("Private Key / Mnemonic:");
const content = yield getPassword("Private Key / Mnemonic:");
return loadAccount(content, plugin, true);
}
// Raw private key
if (ethers.utils.isHexString(arg, 32)) {
let signer = new ethers.Wallet(arg, plugin.provider);
const signer = new ethers.Wallet(arg, plugin.provider);
return Promise.resolve(new WrappedSigner(signer.getAddress(), () => Promise.resolve(signer), plugin));
}
// Mnemonic
Expand Down Expand Up @@ -446,7 +446,7 @@ export class Plugin {
static getOptionHelp() {
return [];
}
prepareOptions(argParser) {
prepareOptions(argParser, verifyOnly) {
return __awaiter(this, void 0, void 0, function* () {
let runners = [];
this.wait = argParser.consumeFlag("wait");
Expand Down Expand Up @@ -495,6 +495,10 @@ export class Plugin {
let account = accountOptions[i];
switch (account.name) {
case "account":
// Verifying does not need to ask for passwords, etc.
if (verifyOnly) {
break;
}
let wrappedSigner = yield loadAccount(account.value, this);
accounts.push(wrappedSigner);
break;
Expand Down Expand Up @@ -529,21 +533,21 @@ export class Plugin {
ethers.utils.defineReadOnly(this, "accounts", Object.freeze(accounts));
/////////////////////
// Transaction Options
let gasPrice = argParser.consumeOption("gas-price");
const gasPrice = argParser.consumeOption("gas-price");
if (gasPrice) {
ethers.utils.defineReadOnly(this, "gasPrice", ethers.utils.parseUnits(gasPrice, "gwei"));
}
else {
ethers.utils.defineReadOnly(this, "gasPrice", null);
}
let gasLimit = argParser.consumeOption("gas-limit");
const gasLimit = argParser.consumeOption("gas-limit");
if (gasLimit) {
ethers.utils.defineReadOnly(this, "gasLimit", ethers.BigNumber.from(gasLimit));
}
else {
ethers.utils.defineReadOnly(this, "gasLimit", null);
}
let nonce = argParser.consumeOption("nonce");
const nonce = argParser.consumeOption("nonce");
if (nonce) {
this.nonce = ethers.BigNumber.from(nonce).toNumber();
}
Expand Down Expand Up @@ -600,6 +604,9 @@ export class Plugin {
}
}
class CheckPlugin extends Plugin {
prepareOptions(argParser, verifyOnly) {
return super.prepareOptions(argParser, true);
}
}
export class CLI {
constructor(defaultCommand, options) {
Expand Down Expand Up @@ -812,7 +819,7 @@ export class CLI {
if (argParser.consumeFlag("help")) {
return this.showUsage();
}
let debug = argParser.consumeFlag("debug");
const debug = argParser.consumeFlag("debug");
// Create Plug-in instance
let plugin = null;
if (this.standAlone) {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/_version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const version = "cli/5.0.0-beta.147";
export declare const version = "cli/5.0.0-beta.148";
2 changes: 1 addition & 1 deletion packages/cli/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 = "cli/5.0.0-beta.147";
exports.version = "cli/5.0.0-beta.148";
18 changes: 13 additions & 5 deletions packages/cli/lib/bin/ethers.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
var fs_1 = __importDefault(require("fs"));
var module_1 = __importDefault(require("module"));
var path_1 = require("path");
var repl_1 = __importDefault(require("repl"));
var util_1 = __importDefault(require("util"));
var vm_1 = __importDefault(require("vm"));
var ethers_1 = require("ethers");
var cli_1 = require("../cli");
var prompt_1 = require("../prompt");
var solc_1 = require("../solc");
function setupContext(context, plugin) {
function setupContext(path, context, plugin) {
context.provider = plugin.provider;
context.accounts = plugin.accounts;
if (!context.__filename) {
context.__filename = path;
}
if (!context.__dirname) {
context.__dirname = path_1.dirname(path);
}
if (!context.console) {
context.console = console;
}
if (!context.require) {
context.require = require;
context.require = module_1.default.createRequireFromPath(path);
}
if (!context.process) {
context.process = process;
Expand Down Expand Up @@ -184,7 +192,7 @@ var SandboxPlugin = /** @class */ (function (_super) {
prompt: (this.provider ? this.network.name : "no-network") + "> ",
writer: promiseWriter
});
setupContext(repl.context, this);
setupContext(path_1.resolve(process.cwd(), "./sandbox.js"), repl.context, this);
return new Promise(function (resolve) {
repl.on("exit", function () {
console.log("");
Expand Down Expand Up @@ -693,7 +701,7 @@ var EvalPlugin = /** @class */ (function (_super) {
switch (_a.label) {
case 0:
contextObject = {};
setupContext(contextObject, this);
setupContext(path_1.resolve(process.cwd(), "./sandbox.js"), contextObject, this);
context = vm_1.default.createContext(contextObject);
script = new vm_1.default.Script(this.code, { filename: "-" });
result = script.runInContext(context);
Expand Down Expand Up @@ -746,7 +754,7 @@ var RunPlugin = /** @class */ (function (_super) {
switch (_a.label) {
case 0:
contextObject = {};
setupContext(contextObject, this);
setupContext(path_1.resolve(this.filename), contextObject, this);
context = vm_1.default.createContext(contextObject);
script = new vm_1.default.Script(fs_1.default.readFileSync(this.filename).toString(), { filename: this.filename });
result = script.runInContext(context);
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/lib/cli.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export declare abstract class Plugin {
constructor();
static getHelp(): Help;
static getOptionHelp(): Array<Help>;
prepareOptions(argParser: ArgParser): Promise<void>;
prepareOptions(argParser: ArgParser, verifyOnly?: boolean): Promise<void>;
prepareArgs(args: Array<string>): Promise<void>;
run(): Promise<void>;
getAddress(addressOrName: string, message?: string, allowZero?: boolean): Promise<string>;
Expand Down
12 changes: 10 additions & 2 deletions packages/cli/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ var Plugin = /** @class */ (function () {
Plugin.getOptionHelp = function () {
return [];
};
Plugin.prototype.prepareOptions = function (argParser) {
Plugin.prototype.prepareOptions = function (argParser, verifyOnly) {
return __awaiter(this, void 0, void 0, function () {
var runners, network, providers, rpc, accounts, accountOptions, _loop_1, this_1, i, gasPrice, gasLimit, nonce, error_3;
var _this = this;
Expand Down Expand Up @@ -670,7 +670,12 @@ var Plugin = /** @class */ (function () {
case "account-void": return [3 /*break*/, 4];
}
return [3 /*break*/, 5];
case 1: return [4 /*yield*/, loadAccount(account.value, this_1)];
case 1:
// Verifying does not need to ask for passwords, etc.
if (verifyOnly) {
return [3 /*break*/, 5];
}
return [4 /*yield*/, loadAccount(account.value, this_1)];
case 2:
wrappedSigner = _b.sent();
accounts.push(wrappedSigner);
Expand Down Expand Up @@ -807,6 +812,9 @@ var CheckPlugin = /** @class */ (function (_super) {
function CheckPlugin() {
return _super !== null && _super.apply(this, arguments) || this;
}
CheckPlugin.prototype.prepareOptions = function (argParser, verifyOnly) {
return _super.prototype.prepareOptions.call(this, argParser, true);
};
return CheckPlugin;
}(Plugin));
var CLI = /** @class */ (function () {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"scripts": {
"test": "exit 1"
},
"tarballHash": "0xd589ee9af478394c353a3630154dd2d561c557ef2539adfd1abe0d0f3b63869a",
"tarballHash": "0x8c1c74059eaf59d10d94fcb2285fb2512a1fdf121ef5c3167e8afa16807bbbb3",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.147"
"version": "5.0.0-beta.148"
}
2 changes: 1 addition & 1 deletion packages/cli/src.ts/_version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "cli/5.0.0-beta.147";
export const version = "cli/5.0.0-beta.148";
2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers-all.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ethers/dist/ethers-all.umd.min.js

Large diffs are not rendered by default.

33 changes: 19 additions & 14 deletions packages/ethers/dist/ethers.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15070,7 +15070,7 @@ function verifyMessage(message, signature) {
return recoverAddress(hashMessage(message), signature);
}

const version$h = "networks/5.0.0-beta.133";
const version$h = "networks/5.0.0-beta.134";

"use strict";
const logger$k = new Logger(version$h);
Expand All @@ -15092,13 +15092,6 @@ function ethDefaultProvider(network) {
}
catch (error) { }
}
/* NodeSmith is being discontinued on 2019-12-20
if (providers.NodesmithProvider) {
try {
providerList.push(new providers.NodesmithProvider(network, options.nodesmith));
} catch(error) { }
}
*/
if (providers.AlchemyProvider) {
try {
providerList.push(new providers.AlchemyProvider(network, options.alchemy));
Expand Down Expand Up @@ -15147,6 +15140,11 @@ const ropsten = {
name: "ropsten",
_defaultProvider: ethDefaultProvider("ropsten")
};
const classicMordor = {
chainId: 63,
name: "classicMordor",
_defaultProvider: etcDefaultProvider("https://www.ethercluster.com/mordor", "classicMordor")
};
const networks = {
unspecified: {
chainId: 0,
Expand Down Expand Up @@ -15177,16 +15175,23 @@ const networks = {
name: "goerli",
_defaultProvider: ethDefaultProvider("goerli")
},
// ETC (See: #351)
classic: {
chainId: 61,
name: "classic",
_defaultProvider: etcDefaultProvider("https://web3.gastracker.io", "classic")
_defaultProvider: etcDefaultProvider("https://www.ethercluster.com/etc", "classic")
},
classicTestnet: {
classicMorden: {
chainId: 62,
name: "classicTestnet",
_defaultProvider: etcDefaultProvider("https://web3.gastracker.io/morden", "classicTestnet")
}
name: "classicMorden",
},
classicMordor: classicMordor,
classicTestnet: classicMordor,
classicKotti: {
chainId: 6,
name: "classicKotti",
_defaultProvider: etcDefaultProvider("https://www.ethercluster.com/kotti", "classicKotti")
},
};
/**
* getNetwork
Expand Down Expand Up @@ -18988,7 +18993,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
Indexed: Indexed
});

const version$l = "ethers/5.0.0-beta.164";
const version$l = "ethers/5.0.0-beta.165";

"use strict";
const errors = Logger.errors;
Expand Down
4 changes: 2 additions & 2 deletions packages/ethers/dist/ethers.esm.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 074eb4b

Please sign in to comment.