Updated dist files.

This commit is contained in:
Richard Moore 2020-01-21 19:08:05 -05:00
parent 251882ced4
commit f92d156f17
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
29 changed files with 152 additions and 67 deletions

View File

@ -3,6 +3,11 @@ Changelog
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
ethers/v5.0.0-beta.170 (2020-01-21 19:07)
-----------------------------------------
- Fixed out-of-bounds difficulty in getBlock, which can affect PoA networks. ([#711](https://github.com/ethers-io/ethers.js/issues/711); [251882c](https://github.com/ethers-io/ethers.js/commit/251882ced4379931ec82ba28a4db10bc7dbf3580))
ethers/v5.0.0-beta.169 (2020-01-20 19:42)
-----------------------------------------

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16216,7 +16216,7 @@ function poll(func, options) {
});
}
const version$j = "providers/5.0.0-beta.150";
const version$j = "providers/5.0.0-beta.151";
"use strict";
const logger$n = new Logger(version$j);
@ -16226,15 +16226,15 @@ class Formatter {
this.formats = this.getDefaultFormats();
}
getDefaultFormats() {
let formats = ({});
let address = this.address.bind(this);
let bigNumber = this.bigNumber.bind(this);
let blockTag = this.blockTag.bind(this);
let data = this.data.bind(this);
let hash = this.hash.bind(this);
let hex = this.hex.bind(this);
let number = this.number.bind(this);
let strictData = (v) => { return this.data(v, true); };
const formats = ({});
const address = this.address.bind(this);
const bigNumber = this.bigNumber.bind(this);
const blockTag = this.blockTag.bind(this);
const data = this.data.bind(this);
const hash = this.hash.bind(this);
const hex = this.hex.bind(this);
const number = this.number.bind(this);
const strictData = (v) => { return this.data(v, true); };
formats.transaction = {
hash: hash,
blockHash: Formatter.allowNull(hash, null),
@ -16362,7 +16362,7 @@ class Formatter {
return logger$n.throwArgumentError("invalid hash", "value", value);
}
data(value, strict) {
let result = this.hex(value, strict);
const result = this.hex(value, strict);
if ((result.length % 2) !== 0) {
throw new Error("invalid data; odd-length - " + value);
}
@ -16377,7 +16377,7 @@ class Formatter {
if (!isHexString(value, 32)) {
return null;
}
let address = getAddress(hexDataSlice(value, 12));
const address = getAddress(hexDataSlice(value, 12));
return (address === AddressZero) ? null : address;
}
contractAddress(value) {
@ -16401,7 +16401,7 @@ class Formatter {
}
// Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash.
hash(value, strict) {
let result = this.hex(value, strict);
const result = this.hex(value, strict);
if (hexDataLength(result) !== 32) {
return logger$n.throwArgumentError("invalid hash", "value", value);
}
@ -16409,7 +16409,10 @@ class Formatter {
}
// Returns the difficulty as a number, or if too large (i.e. PoA network) null
difficulty(value) {
let v = BigNumber.from(value);
if (value == null) {
return null;
}
const v = BigNumber.from(value);
try {
return v.toNumber();
}
@ -16478,7 +16481,7 @@ class Formatter {
}
}
*/
let result = Formatter.check(this.formats.transaction, transaction);
const result = Formatter.check(this.formats.transaction, transaction);
if (transaction.chainId != null) {
let chainId = transaction.chainId;
if (isHexString(chainId)) {
@ -16522,7 +16525,7 @@ class Formatter {
receipt(value) {
//let status = transactionReceipt.status;
//let root = transactionReceipt.root;
let result = Formatter.check(this.formats.receipt, value);
const result = Formatter.check(this.formats.receipt, value);
result.logs.forEach((entry, index) => {
if (entry.transactionLogIndex == null) {
entry.transactionLogIndex = index;
@ -16549,10 +16552,10 @@ class Formatter {
return Formatter.check(this.formats.filterLog, value);
}
static check(format, object) {
let result = {};
for (let key in format) {
const result = {};
for (const key in format) {
try {
let value = format[key](object[key]);
const value = format[key](object[key]);
if (value !== undefined) {
result[key] = value;
}
@ -16589,7 +16592,7 @@ class Formatter {
if (!Array.isArray(array)) {
throw new Error("not an array");
}
let result = [];
const result = [];
array.forEach(function (value) {
result.push(format(value));
});
@ -19270,7 +19273,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
Indexed: Indexed
});
const version$l = "ethers/5.0.0-beta.169";
const version$l = "ethers/5.0.0-beta.170";
"use strict";
const errors = Logger.errors;

File diff suppressed because one or more lines are too long

View File

@ -17661,7 +17661,7 @@
var _version$G = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.0-beta.150";
exports.version = "providers/5.0.0-beta.151";
});
var _version$H = unwrapExports(_version$G);
@ -17870,6 +17870,9 @@
};
// Returns the difficulty as a number, or if too large (i.e. PoA network) null
Formatter.prototype.difficulty = function (value) {
if (value == null) {
return null;
}
var v = lib$2.BigNumber.from(value);
try {
return v.toNumber();
@ -21781,7 +21784,7 @@
var _version$K = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.169";
exports.version = "ethers/5.0.0-beta.170";
});
var _version$L = unwrapExports(_version$K);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.169";
export declare const version = "ethers/5.0.0-beta.170";

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.169";
export const version = "ethers/5.0.0-beta.170";

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.169";
export declare const version = "ethers/5.0.0-beta.170";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.169";
exports.version = "ethers/5.0.0-beta.170";

View File

@ -52,7 +52,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x0be2fd19526c4a53003df509398cf5266a60b9f3792c534e5cb0178af97faa01",
"tarballHash": "0xda5868f4939f7d6b03cd8f0fc273209321e1e0885054a9c3b1eba25fe1757e85",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.169"
"version": "5.0.0-beta.170"
}

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.169";
export const version = "ethers/5.0.0-beta.170";

View File

@ -1 +1 @@
export declare const version = "providers/5.0.0-beta.150";
export declare const version = "providers/5.0.0-beta.151";

View File

@ -1 +1 @@
export const version = "providers/5.0.0-beta.150";
export const version = "providers/5.0.0-beta.151";

View File

@ -14,15 +14,15 @@ export class Formatter {
this.formats = this.getDefaultFormats();
}
getDefaultFormats() {
let formats = ({});
let address = this.address.bind(this);
let bigNumber = this.bigNumber.bind(this);
let blockTag = this.blockTag.bind(this);
let data = this.data.bind(this);
let hash = this.hash.bind(this);
let hex = this.hex.bind(this);
let number = this.number.bind(this);
let strictData = (v) => { return this.data(v, true); };
const formats = ({});
const address = this.address.bind(this);
const bigNumber = this.bigNumber.bind(this);
const blockTag = this.blockTag.bind(this);
const data = this.data.bind(this);
const hash = this.hash.bind(this);
const hex = this.hex.bind(this);
const number = this.number.bind(this);
const strictData = (v) => { return this.data(v, true); };
formats.transaction = {
hash: hash,
blockHash: Formatter.allowNull(hash, null),
@ -150,7 +150,7 @@ export class Formatter {
return logger.throwArgumentError("invalid hash", "value", value);
}
data(value, strict) {
let result = this.hex(value, strict);
const result = this.hex(value, strict);
if ((result.length % 2) !== 0) {
throw new Error("invalid data; odd-length - " + value);
}
@ -165,7 +165,7 @@ export class Formatter {
if (!isHexString(value, 32)) {
return null;
}
let address = getAddress(hexDataSlice(value, 12));
const address = getAddress(hexDataSlice(value, 12));
return (address === AddressZero) ? null : address;
}
contractAddress(value) {
@ -189,7 +189,7 @@ export class Formatter {
}
// Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash.
hash(value, strict) {
let result = this.hex(value, strict);
const result = this.hex(value, strict);
if (hexDataLength(result) !== 32) {
return logger.throwArgumentError("invalid hash", "value", value);
}
@ -197,7 +197,10 @@ export class Formatter {
}
// Returns the difficulty as a number, or if too large (i.e. PoA network) null
difficulty(value) {
let v = BigNumber.from(value);
if (value == null) {
return null;
}
const v = BigNumber.from(value);
try {
return v.toNumber();
}
@ -266,7 +269,7 @@ export class Formatter {
}
}
*/
let result = Formatter.check(this.formats.transaction, transaction);
const result = Formatter.check(this.formats.transaction, transaction);
if (transaction.chainId != null) {
let chainId = transaction.chainId;
if (isHexString(chainId)) {
@ -310,7 +313,7 @@ export class Formatter {
receipt(value) {
//let status = transactionReceipt.status;
//let root = transactionReceipt.root;
let result = Formatter.check(this.formats.receipt, value);
const result = Formatter.check(this.formats.receipt, value);
result.logs.forEach((entry, index) => {
if (entry.transactionLogIndex == null) {
entry.transactionLogIndex = index;
@ -337,10 +340,10 @@ export class Formatter {
return Formatter.check(this.formats.filterLog, value);
}
static check(format, object) {
let result = {};
for (let key in format) {
const result = {};
for (const key in format) {
try {
let value = format[key](object[key]);
const value = format[key](object[key]);
if (value !== undefined) {
result[key] = value;
}
@ -377,7 +380,7 @@ export class Formatter {
if (!Array.isArray(array)) {
throw new Error("not an array");
}
let result = [];
const result = [];
array.forEach(function (value) {
result.push(format(value));
});

View File

@ -1 +1 @@
export declare const version = "providers/5.0.0-beta.150";
export declare const version = "providers/5.0.0-beta.151";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.0-beta.150";
exports.version = "providers/5.0.0-beta.151";

View File

@ -200,6 +200,9 @@ var Formatter = /** @class */ (function () {
};
// Returns the difficulty as a number, or if too large (i.e. PoA network) null
Formatter.prototype.difficulty = function (value) {
if (value == null) {
return null;
}
var v = bignumber_1.BigNumber.from(value);
try {
return v.toNumber();

View File

@ -44,7 +44,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x9b8cc17fb3a150bfaac9db6721a6664786217ef20fc47954aa1bfc94e1b2689e",
"tarballHash": "0xc3a477e4ef5e3d7ca066c9c69324ae9d45a6cf21575df61b09b4361c3d79fde2",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.150"
"version": "5.0.0-beta.151"
}

View File

@ -1 +1 @@
export const version = "providers/5.0.0-beta.150";
export const version = "providers/5.0.0-beta.151";

View File

@ -1 +1 @@
export declare const version = "tests/5.0.0-beta.148";
export declare const version = "tests/5.0.0-beta.149";

View File

@ -1 +1 @@
export const version = "tests/5.0.0-beta.148";
export const version = "tests/5.0.0-beta.149";

View File

@ -124,6 +124,25 @@ const blockchainData = {
extraData: "0xd5830105048650617269747986312e31352e31826c69",
transactions: []
},
// See: #711
block16265864: {
hash: "0xd92891a6eeaed4892289edf9bd5ebff261da5c6a51f7131cc1a481c6f4d1aa75",
parentHash: "0xcc769a02513be1df80eee7d3a5cb87f14f37baee03c13f3e3ad1e7bdcaf7dac3",
number: 16265864,
timestamp: 1579621004,
difficulty: null,
gasLimit: bnify("0x989680"),
gasUsed: bnify("0x0705bf"),
miner: "0x596e8221A30bFe6e7eFF67Fee664A01C73BA3C56",
extraData: "0xde830206088f5061726974792d457468657265756d86312e34302e30826c69",
transactions: [
"0x20e6760fa1297fb06c8c20e6ed99581e0ba964d51167ea3c8ff580bfcb10bfc3",
"0x0ce7eba48b1bbdee05823b79ae24e741f3f290d0abfef8ae9adf32db108b7dd6",
"0x1fa2baafa844bf4853e4abbbf49532bf570210d589dc626dbf7ebc4832bdfa5d",
"0xdb5d1fa54d30a4b6aee0b242a2c68ea52d3dd28703f69e6e30871827850aa2fa",
"0xcc898db85d7d2493d4778faf640be32a4a3b7f5f987257bdc0009ce75a18eeaa"
]
},
},
rinkeby: {
balance: {
@ -327,6 +346,21 @@ function testProvider(providerName, networkName) {
assert.ok(false);
});
});
// Kovan Test Case: See #711
if (blockchainData[networkName].block16265864) {
it("fetches block #16265864", function () {
this.timeout(20000);
let test = blockchainData[networkName].block16265864;
return provider.getBlock(16265864).then((block) => {
for (let key in test) {
equals("Block " + key, block[key], test[key]);
}
}, (error) => {
console.log("Error", error);
assert.ok(false);
});
});
}
it("fetches address balance", function () {
// @TODO: These tests could be fiddled with if someone sends ether to our address
// We should set up a contract on each network like:

View File

@ -1 +1 @@
export declare const version = "tests/5.0.0-beta.148";
export declare const version = "tests/5.0.0-beta.149";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "tests/5.0.0-beta.148";
exports.version = "tests/5.0.0-beta.149";

View File

@ -128,6 +128,25 @@ var blockchainData = {
extraData: "0xd5830105048650617269747986312e31352e31826c69",
transactions: []
},
// See: #711
block16265864: {
hash: "0xd92891a6eeaed4892289edf9bd5ebff261da5c6a51f7131cc1a481c6f4d1aa75",
parentHash: "0xcc769a02513be1df80eee7d3a5cb87f14f37baee03c13f3e3ad1e7bdcaf7dac3",
number: 16265864,
timestamp: 1579621004,
difficulty: null,
gasLimit: bnify("0x989680"),
gasUsed: bnify("0x0705bf"),
miner: "0x596e8221A30bFe6e7eFF67Fee664A01C73BA3C56",
extraData: "0xde830206088f5061726974792d457468657265756d86312e34302e30826c69",
transactions: [
"0x20e6760fa1297fb06c8c20e6ed99581e0ba964d51167ea3c8ff580bfcb10bfc3",
"0x0ce7eba48b1bbdee05823b79ae24e741f3f290d0abfef8ae9adf32db108b7dd6",
"0x1fa2baafa844bf4853e4abbbf49532bf570210d589dc626dbf7ebc4832bdfa5d",
"0xdb5d1fa54d30a4b6aee0b242a2c68ea52d3dd28703f69e6e30871827850aa2fa",
"0xcc898db85d7d2493d4778faf640be32a4a3b7f5f987257bdc0009ce75a18eeaa"
]
},
},
rinkeby: {
balance: {
@ -331,6 +350,21 @@ function testProvider(providerName, networkName) {
assert_1.default.ok(false);
});
});
// Kovan Test Case: See #711
if (blockchainData[networkName].block16265864) {
it("fetches block #16265864", function () {
this.timeout(20000);
var test = blockchainData[networkName].block16265864;
return provider.getBlock(16265864).then(function (block) {
for (var key in test) {
equals("Block " + key, block[key], test[key]);
}
}, function (error) {
console.log("Error", error);
assert_1.default.ok(false);
});
});
}
it("fetches address balance", function () {
// @TODO: These tests could be fiddled with if someone sends ether to our address
// We should set up a contract on each network like:

View File

@ -35,7 +35,7 @@
"scripts": {
"test": "exit 1"
},
"tarballHash": "0x46b13fc88079d777e1d312f876c77f9e333715e74518e7a599bce96336eca5a2",
"tarballHash": "0x229bcb73523facf8020de6af653f4d12de9f838f6ca47ef554afb7ccf42feff5",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.148"
"version": "5.0.0-beta.149"
}

View File

@ -1 +1 @@
export const version = "tests/5.0.0-beta.148";
export const version = "tests/5.0.0-beta.149";