admin: updated dist files

This commit is contained in:
Richard Moore 2022-03-09 14:58:07 -05:00
parent fa4a29028d
commit dfaa8ee7e6
25 changed files with 131 additions and 103 deletions

@ -4,10 +4,13 @@ Changelog
This change log is managed by `admin/cmds/update-versions` but may be manually updated. This change log is managed by `admin/cmds/update-versions` but may be manually updated.
ethers/v5.6.0 (2022-03-09 02:13) ethers/v5.6.0 (2022-03-09 14:57)
-------------------------------- --------------------------------
- Fix missing events on certain network conditions. ([#1798](https://github.com/ethers-io/ethers.js/issues/1798), [#1814](https://github.com/ethers-io/ethers.js/issues/1814), [#1830](https://github.com/ethers-io/ethers.js/issues/1830), [#2274](https://github.com/ethers-io/ethers.js/issues/2274), [#2652](https://github.com/ethers-io/ethers.js/issues/2652); [f67a9a8](https://github.com/ethers-io/ethers.js/commit/f67a9a8569cdfd0ef9ce5fbf09866aab6e4814d4)) - Tweaked test case to re-order transaction after event listeners added. ([fa4a290](https://github.com/ethers-io/ethers.js/commit/fa4a29028d97d598b43b2f5ff98077e8cadf56a4))
- Ignore errors when resolving ENS resolver properties. ([d160bac](https://github.com/ethers-io/ethers.js/commit/d160bac273775f928a9441b0275dbdb6032368fa))
- Enable CCIP Read for ENS resolvers. ([#2478](https://github.com/ethers-io/ethers.js/issues/2478); [be518c3](https://github.com/ethers-io/ethers.js/commit/be518c32ec7db9dd4769b57cdf130eb333aebb72))
- Fix missing events on certain network conditions. ([#1798](https://github.com/ethers-io/ethers.js/issues/1798), [#1814](https://github.com/ethers-io/ethers.js/issues/1814), [#1830](https://github.com/ethers-io/ethers.js/issues/1830), [#2274](https://github.com/ethers-io/ethers.js/issues/2274), [#2652](https://github.com/ethers-io/ethers.js/issues/2652); [f67a9a8](https://github.com/ethers-io/ethers.js/commit/f67a9a8569cdfd0ef9ce5fbf09866aab6e4814d4), [f46aa75](https://github.com/ethers-io/ethers.js/commit/f46aa75ef1f3428e640cd046db3f080d264b32f3))
- Added defaultProvider option to omit specific Providers. ([bae215e](https://github.com/ethers-io/ethers.js/commit/bae215eb7fb3efea8473a544579abac1bebb7ef0)) - Added defaultProvider option to omit specific Providers. ([bae215e](https://github.com/ethers-io/ethers.js/commit/bae215eb7fb3efea8473a544579abac1bebb7ef0))
- Add support for pending blocks. ([#2225](https://github.com/ethers-io/ethers.js/issues/2225); [54e6e57](https://github.com/ethers-io/ethers.js/commit/54e6e57fcece4c1718a577ecbeb1af97998e8bdc)) - Add support for pending blocks. ([#2225](https://github.com/ethers-io/ethers.js/issues/2225); [54e6e57](https://github.com/ethers-io/ethers.js/commit/54e6e57fcece4c1718a577ecbeb1af97998e8bdc))
- Help URLs for errors. ([#2489](https://github.com/ethers-io/ethers.js/issues/2489); [38e825c](https://github.com/ethers-io/ethers.js/commit/38e825cee624ff935ec6b70023cf288126a6bb85), [c562150](https://github.com/ethers-io/ethers.js/commit/c562150d2678710f50e5ee3ffa88d0e62d6f696f)) - Help URLs for errors. ([#2489](https://github.com/ethers-io/ethers.js/issues/2489); [38e825c](https://github.com/ethers-io/ethers.js/commit/38e825cee624ff935ec6b70023cf288126a6bb85), [c562150](https://github.com/ethers-io/ethers.js/commit/c562150d2678710f50e5ee3ffa88d0e62d6f696f))

6
package-lock.json generated

@ -1771,9 +1771,9 @@
"dev": true "dev": true
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.4.78", "version": "1.4.79",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.78.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.79.tgz",
"integrity": "sha512-o61+D/Lx7j/E0LIin/efOqeHpXhwi1TaQco9vUcRmr91m25SfZY6L5hWJDv/r+6kNjboFKgBw1LbfM0lbhuK6Q==", "integrity": "sha512-nWfAxof87mGHkbORCwVRPst4FlSVdprOKS6dBMrcwn3sjwf8iHXEhsu1+FU5Psd7Ps3KKeBufAdfsPK5BmbSUg==",
"dev": true "dev": true
}, },
"elliptic": { "elliptic": {

@ -18754,6 +18754,8 @@ class Event {
defineReadOnly(this, "tag", tag); defineReadOnly(this, "tag", tag);
defineReadOnly(this, "listener", listener); defineReadOnly(this, "listener", listener);
defineReadOnly(this, "once", once); defineReadOnly(this, "once", once);
this._lastBlockNumber = -2;
this._inflight = false;
} }
get event() { get event() {
switch (this.type) { switch (this.type) {
@ -18915,6 +18917,7 @@ class Resolver {
// e.g. keccak256("addr(bytes32,uint256)") // e.g. keccak256("addr(bytes32,uint256)")
const tx = { const tx = {
to: this.address, to: this.address,
ccipReadEnabled: true,
data: hexConcat([selector, namehash(this.name), (parameters || "0x")]) data: hexConcat([selector, namehash(this.name), (parameters || "0x")])
}; };
// Wildcard support; use EIP-2544 to resolve the request // Wildcard support; use EIP-2544 to resolve the request
@ -18926,6 +18929,11 @@ class Resolver {
} }
try { try {
let result = yield this.provider.call(tx); let result = yield this.provider.call(tx);
if ((arrayify(result).length % 32) === 4) {
logger$t.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
transaction: tx, data: result
});
}
if (parseBytes) { if (parseBytes) {
result = _parseBytes(result, 0); result = _parseBytes(result, 0);
} }
@ -18935,7 +18943,7 @@ class Resolver {
if (error.code === Logger.errors.CALL_EXCEPTION) { if (error.code === Logger.errors.CALL_EXCEPTION) {
return null; return null;
} }
return null; throw error;
} }
}); });
} }
@ -19248,8 +19256,6 @@ class BaseProvider extends Provider {
} }
this._maxInternalBlockNumber = -1024; this._maxInternalBlockNumber = -1024;
this._lastBlockNumber = -2; this._lastBlockNumber = -2;
this._lastFilterBlockNumber = -2;
this._lastFilterComplete = true;
this._maxFilterBlockRange = 10; this._maxFilterBlockRange = 10;
this._pollingInterval = 4000; this._pollingInterval = 4000;
this._fastQueryDate = 0; this._fastQueryDate = 0;
@ -19477,8 +19483,6 @@ class BaseProvider extends Provider {
// First polling cycle // First polling cycle
if (this._lastBlockNumber === -2) { if (this._lastBlockNumber === -2) {
this._lastBlockNumber = blockNumber - 1; this._lastBlockNumber = blockNumber - 1;
this._lastFilterBlockNumber = blockNumber - 1;
this._lastFilterComplete = true;
} }
// Find all transaction hashes we are waiting on // Find all transaction hashes we are waiting on
this._events.forEach((event) => { this._events.forEach((event) => {
@ -19498,14 +19502,14 @@ class BaseProvider extends Provider {
} }
case "filter": { case "filter": {
// We only allow a single getLogs to be in-flight at a time // We only allow a single getLogs to be in-flight at a time
if (this._lastFilterComplete) { if (!event._inflight) {
this._lastFilterComplete = false; event._inflight = true;
// Filter from the last known event; due to load-balancing // Filter from the last known event; due to load-balancing
// and some nodes returning updated block numbers before // and some nodes returning updated block numbers before
// indexing events, a logs result with 0 entries cannot be // indexing events, a logs result with 0 entries cannot be
// trusted and we must retry a range which includes it again // trusted and we must retry a range which includes it again
const filter = event.filter; const filter = event.filter;
filter.fromBlock = this._lastFilterBlockNumber + 1; filter.fromBlock = event._lastBlockNumber + 1;
filter.toBlock = blockNumber; filter.toBlock = blockNumber;
// Prevent fitler ranges from growing too wild // Prevent fitler ranges from growing too wild
if (filter.toBlock - this._maxFilterBlockRange > filter.fromBlock) { if (filter.toBlock - this._maxFilterBlockRange > filter.fromBlock) {
@ -19513,15 +19517,15 @@ class BaseProvider extends Provider {
} }
const runner = this.getLogs(filter).then((logs) => { const runner = this.getLogs(filter).then((logs) => {
// Allow the next getLogs // Allow the next getLogs
this._lastFilterComplete = true; event._inflight = false;
if (logs.length === 0) { if (logs.length === 0) {
return; return;
} }
logs.forEach((log) => { logs.forEach((log) => {
// Only when we get an event for a given block number // Only when we get an event for a given block number
// can we trust the events are indexed // can we trust the events are indexed
if (log.blockNumber > this._lastFilterBlockNumber) { if (log.blockNumber > event._lastBlockNumber) {
this._lastFilterBlockNumber = log.blockNumber; event._lastBlockNumber = log.blockNumber;
} }
// Make sure we stall requests to fetch blocks and txs // Make sure we stall requests to fetch blocks and txs
this._emitted["b:" + log.blockHash] = log.blockNumber; this._emitted["b:" + log.blockHash] = log.blockNumber;
@ -19531,7 +19535,7 @@ class BaseProvider extends Provider {
}).catch((error) => { }).catch((error) => {
this.emit("error", error); this.emit("error", error);
// Allow another getLogs (the range was not updated) // Allow another getLogs (the range was not updated)
this._lastFilterComplete = true; event._inflight = false;
}); });
runners.push(runner); runners.push(runner);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -20970,6 +20970,8 @@
(0, lib$3.defineReadOnly)(this, "tag", tag); (0, lib$3.defineReadOnly)(this, "tag", tag);
(0, lib$3.defineReadOnly)(this, "listener", listener); (0, lib$3.defineReadOnly)(this, "listener", listener);
(0, lib$3.defineReadOnly)(this, "once", once); (0, lib$3.defineReadOnly)(this, "once", once);
this._lastBlockNumber = -2;
this._inflight = false;
} }
Object.defineProperty(Event.prototype, "event", { Object.defineProperty(Event.prototype, "event", {
get: function () { get: function () {
@ -21153,6 +21155,7 @@
case 0: case 0:
tx = { tx = {
to: this.address, to: this.address,
ccipReadEnabled: true,
data: (0, lib$1.hexConcat)([selector, (0, lib$9.namehash)(this.name), (parameters || "0x")]) data: (0, lib$1.hexConcat)([selector, (0, lib$9.namehash)(this.name), (parameters || "0x")])
}; };
parseBytes = false; parseBytes = false;
@ -21169,6 +21172,11 @@
return [4 /*yield*/, this.provider.call(tx)]; return [4 /*yield*/, this.provider.call(tx)];
case 3: case 3:
result = _a.sent(); result = _a.sent();
if (((0, lib$1.arrayify)(result).length % 32) === 4) {
logger.throwError("resolver threw error", lib.Logger.errors.CALL_EXCEPTION, {
transaction: tx, data: result
});
}
if (parseBytes) { if (parseBytes) {
result = _parseBytes(result, 0); result = _parseBytes(result, 0);
} }
@ -21178,7 +21186,7 @@
if (error_1.code === lib.Logger.errors.CALL_EXCEPTION) { if (error_1.code === lib.Logger.errors.CALL_EXCEPTION) {
return [2 /*return*/, null]; return [2 /*return*/, null];
} }
return [2 /*return*/, null]; throw error_1;
case 5: return [2 /*return*/]; case 5: return [2 /*return*/];
} }
}); });
@ -21555,8 +21563,6 @@
} }
_this._maxInternalBlockNumber = -1024; _this._maxInternalBlockNumber = -1024;
_this._lastBlockNumber = -2; _this._lastBlockNumber = -2;
_this._lastFilterBlockNumber = -2;
_this._lastFilterComplete = true;
_this._maxFilterBlockRange = 10; _this._maxFilterBlockRange = 10;
_this._pollingInterval = 4000; _this._pollingInterval = 4000;
_this._fastQueryDate = 0; _this._fastQueryDate = 0;
@ -21838,8 +21844,6 @@
// First polling cycle // First polling cycle
if (this._lastBlockNumber === -2) { if (this._lastBlockNumber === -2) {
this._lastBlockNumber = blockNumber - 1; this._lastBlockNumber = blockNumber - 1;
this._lastFilterBlockNumber = blockNumber - 1;
this._lastFilterComplete = true;
} }
// Find all transaction hashes we are waiting on // Find all transaction hashes we are waiting on
this._events.forEach(function (event) { this._events.forEach(function (event) {
@ -21859,14 +21863,14 @@
} }
case "filter": { case "filter": {
// We only allow a single getLogs to be in-flight at a time // We only allow a single getLogs to be in-flight at a time
if (_this._lastFilterComplete) { if (!event._inflight) {
_this._lastFilterComplete = false; event._inflight = true;
// Filter from the last known event; due to load-balancing // Filter from the last known event; due to load-balancing
// and some nodes returning updated block numbers before // and some nodes returning updated block numbers before
// indexing events, a logs result with 0 entries cannot be // indexing events, a logs result with 0 entries cannot be
// trusted and we must retry a range which includes it again // trusted and we must retry a range which includes it again
var filter_1 = event.filter; var filter_1 = event.filter;
filter_1.fromBlock = _this._lastFilterBlockNumber + 1; filter_1.fromBlock = event._lastBlockNumber + 1;
filter_1.toBlock = blockNumber; filter_1.toBlock = blockNumber;
// Prevent fitler ranges from growing too wild // Prevent fitler ranges from growing too wild
if (filter_1.toBlock - _this._maxFilterBlockRange > filter_1.fromBlock) { if (filter_1.toBlock - _this._maxFilterBlockRange > filter_1.fromBlock) {
@ -21874,15 +21878,15 @@
} }
var runner = _this.getLogs(filter_1).then(function (logs) { var runner = _this.getLogs(filter_1).then(function (logs) {
// Allow the next getLogs // Allow the next getLogs
_this._lastFilterComplete = true; event._inflight = false;
if (logs.length === 0) { if (logs.length === 0) {
return; return;
} }
logs.forEach(function (log) { logs.forEach(function (log) {
// Only when we get an event for a given block number // Only when we get an event for a given block number
// can we trust the events are indexed // can we trust the events are indexed
if (log.blockNumber > _this._lastFilterBlockNumber) { if (log.blockNumber > event._lastBlockNumber) {
_this._lastFilterBlockNumber = log.blockNumber; event._lastBlockNumber = log.blockNumber;
} }
// Make sure we stall requests to fetch blocks and txs // Make sure we stall requests to fetch blocks and txs
_this._emitted["b:" + log.blockHash] = log.blockNumber; _this._emitted["b:" + log.blockHash] = log.blockNumber;
@ -21892,7 +21896,7 @@
}).catch(function (error) { }).catch(function (error) {
_this.emit("error", error); _this.emit("error", error);
// Allow another getLogs (the range was not updated) // Allow another getLogs (the range was not updated)
_this._lastFilterComplete = true; event._inflight = false;
}); });
runners.push(runner); runners.push(runner);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -62,7 +62,7 @@
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"sideEffects": false, "sideEffects": false,
"tarballHash": "0xde258a41bb37aa169c4a16d7f4e1fd098fca5de1954ddf37f27317483a43afd4", "tarballHash": "0xbf8af0bc133a052a3e410a1d9c98b59b2785ed29e27243c76db9011df98067a0",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"version": "5.6.0" "version": "5.6.0"
} }

@ -9,6 +9,8 @@ export declare class Event {
readonly listener: Listener; readonly listener: Listener;
readonly once: boolean; readonly once: boolean;
readonly tag: string; readonly tag: string;
_lastBlockNumber: number;
_inflight: boolean;
constructor(tag: string, listener: Listener, once: boolean); constructor(tag: string, listener: Listener, once: boolean);
get event(): EventType; get event(): EventType;
get type(): string; get type(): string;
@ -63,8 +65,6 @@ export declare class BaseProvider extends Provider implements EnsProvider {
_poller: NodeJS.Timer; _poller: NodeJS.Timer;
_bootstrapPoll: NodeJS.Timer; _bootstrapPoll: NodeJS.Timer;
_lastBlockNumber: number; _lastBlockNumber: number;
_lastFilterBlockNumber: number;
_lastFilterComplete: boolean;
_maxFilterBlockRange: number; _maxFilterBlockRange: number;
_fastBlockNumber: number; _fastBlockNumber: number;
_fastBlockNumberPromise: Promise<number>; _fastBlockNumberPromise: Promise<number>;

File diff suppressed because one or more lines are too long

@ -125,6 +125,8 @@ export class Event {
defineReadOnly(this, "tag", tag); defineReadOnly(this, "tag", tag);
defineReadOnly(this, "listener", listener); defineReadOnly(this, "listener", listener);
defineReadOnly(this, "once", once); defineReadOnly(this, "once", once);
this._lastBlockNumber = -2;
this._inflight = false;
} }
get event() { get event() {
switch (this.type) { switch (this.type) {
@ -286,6 +288,7 @@ export class Resolver {
// e.g. keccak256("addr(bytes32,uint256)") // e.g. keccak256("addr(bytes32,uint256)")
const tx = { const tx = {
to: this.address, to: this.address,
ccipReadEnabled: true,
data: hexConcat([selector, namehash(this.name), (parameters || "0x")]) data: hexConcat([selector, namehash(this.name), (parameters || "0x")])
}; };
// Wildcard support; use EIP-2544 to resolve the request // Wildcard support; use EIP-2544 to resolve the request
@ -297,6 +300,11 @@ export class Resolver {
} }
try { try {
let result = yield this.provider.call(tx); let result = yield this.provider.call(tx);
if ((arrayify(result).length % 32) === 4) {
logger.throwError("resolver threw error", Logger.errors.CALL_EXCEPTION, {
transaction: tx, data: result
});
}
if (parseBytes) { if (parseBytes) {
result = _parseBytes(result, 0); result = _parseBytes(result, 0);
} }
@ -306,7 +314,7 @@ export class Resolver {
if (error.code === Logger.errors.CALL_EXCEPTION) { if (error.code === Logger.errors.CALL_EXCEPTION) {
return null; return null;
} }
return null; throw error;
} }
}); });
} }
@ -619,8 +627,6 @@ export class BaseProvider extends Provider {
} }
this._maxInternalBlockNumber = -1024; this._maxInternalBlockNumber = -1024;
this._lastBlockNumber = -2; this._lastBlockNumber = -2;
this._lastFilterBlockNumber = -2;
this._lastFilterComplete = true;
this._maxFilterBlockRange = 10; this._maxFilterBlockRange = 10;
this._pollingInterval = 4000; this._pollingInterval = 4000;
this._fastQueryDate = 0; this._fastQueryDate = 0;
@ -848,8 +854,6 @@ export class BaseProvider extends Provider {
// First polling cycle // First polling cycle
if (this._lastBlockNumber === -2) { if (this._lastBlockNumber === -2) {
this._lastBlockNumber = blockNumber - 1; this._lastBlockNumber = blockNumber - 1;
this._lastFilterBlockNumber = blockNumber - 1;
this._lastFilterComplete = true;
} }
// Find all transaction hashes we are waiting on // Find all transaction hashes we are waiting on
this._events.forEach((event) => { this._events.forEach((event) => {
@ -869,14 +873,14 @@ export class BaseProvider extends Provider {
} }
case "filter": { case "filter": {
// We only allow a single getLogs to be in-flight at a time // We only allow a single getLogs to be in-flight at a time
if (this._lastFilterComplete) { if (!event._inflight) {
this._lastFilterComplete = false; event._inflight = true;
// Filter from the last known event; due to load-balancing // Filter from the last known event; due to load-balancing
// and some nodes returning updated block numbers before // and some nodes returning updated block numbers before
// indexing events, a logs result with 0 entries cannot be // indexing events, a logs result with 0 entries cannot be
// trusted and we must retry a range which includes it again // trusted and we must retry a range which includes it again
const filter = event.filter; const filter = event.filter;
filter.fromBlock = this._lastFilterBlockNumber + 1; filter.fromBlock = event._lastBlockNumber + 1;
filter.toBlock = blockNumber; filter.toBlock = blockNumber;
// Prevent fitler ranges from growing too wild // Prevent fitler ranges from growing too wild
if (filter.toBlock - this._maxFilterBlockRange > filter.fromBlock) { if (filter.toBlock - this._maxFilterBlockRange > filter.fromBlock) {
@ -884,15 +888,15 @@ export class BaseProvider extends Provider {
} }
const runner = this.getLogs(filter).then((logs) => { const runner = this.getLogs(filter).then((logs) => {
// Allow the next getLogs // Allow the next getLogs
this._lastFilterComplete = true; event._inflight = false;
if (logs.length === 0) { if (logs.length === 0) {
return; return;
} }
logs.forEach((log) => { logs.forEach((log) => {
// Only when we get an event for a given block number // Only when we get an event for a given block number
// can we trust the events are indexed // can we trust the events are indexed
if (log.blockNumber > this._lastFilterBlockNumber) { if (log.blockNumber > event._lastBlockNumber) {
this._lastFilterBlockNumber = log.blockNumber; event._lastBlockNumber = log.blockNumber;
} }
// Make sure we stall requests to fetch blocks and txs // Make sure we stall requests to fetch blocks and txs
this._emitted["b:" + log.blockHash] = log.blockNumber; this._emitted["b:" + log.blockHash] = log.blockNumber;
@ -902,7 +906,7 @@ export class BaseProvider extends Provider {
}).catch((error) => { }).catch((error) => {
this.emit("error", error); this.emit("error", error);
// Allow another getLogs (the range was not updated) // Allow another getLogs (the range was not updated)
this._lastFilterComplete = true; event._inflight = false;
}); });
runners.push(runner); runners.push(runner);
} }

File diff suppressed because one or more lines are too long

@ -9,6 +9,8 @@ export declare class Event {
readonly listener: Listener; readonly listener: Listener;
readonly once: boolean; readonly once: boolean;
readonly tag: string; readonly tag: string;
_lastBlockNumber: number;
_inflight: boolean;
constructor(tag: string, listener: Listener, once: boolean); constructor(tag: string, listener: Listener, once: boolean);
get event(): EventType; get event(): EventType;
get type(): string; get type(): string;
@ -63,8 +65,6 @@ export declare class BaseProvider extends Provider implements EnsProvider {
_poller: NodeJS.Timer; _poller: NodeJS.Timer;
_bootstrapPoll: NodeJS.Timer; _bootstrapPoll: NodeJS.Timer;
_lastBlockNumber: number; _lastBlockNumber: number;
_lastFilterBlockNumber: number;
_lastFilterComplete: boolean;
_maxFilterBlockRange: number; _maxFilterBlockRange: number;
_fastBlockNumber: number; _fastBlockNumber: number;
_fastBlockNumberPromise: Promise<number>; _fastBlockNumberPromise: Promise<number>;

File diff suppressed because one or more lines are too long

@ -172,6 +172,8 @@ var Event = /** @class */ (function () {
(0, properties_1.defineReadOnly)(this, "tag", tag); (0, properties_1.defineReadOnly)(this, "tag", tag);
(0, properties_1.defineReadOnly)(this, "listener", listener); (0, properties_1.defineReadOnly)(this, "listener", listener);
(0, properties_1.defineReadOnly)(this, "once", once); (0, properties_1.defineReadOnly)(this, "once", once);
this._lastBlockNumber = -2;
this._inflight = false;
} }
Object.defineProperty(Event.prototype, "event", { Object.defineProperty(Event.prototype, "event", {
get: function () { get: function () {
@ -355,6 +357,7 @@ var Resolver = /** @class */ (function () {
case 0: case 0:
tx = { tx = {
to: this.address, to: this.address,
ccipReadEnabled: true,
data: (0, bytes_1.hexConcat)([selector, (0, hash_1.namehash)(this.name), (parameters || "0x")]) data: (0, bytes_1.hexConcat)([selector, (0, hash_1.namehash)(this.name), (parameters || "0x")])
}; };
parseBytes = false; parseBytes = false;
@ -371,6 +374,11 @@ var Resolver = /** @class */ (function () {
return [4 /*yield*/, this.provider.call(tx)]; return [4 /*yield*/, this.provider.call(tx)];
case 3: case 3:
result = _a.sent(); result = _a.sent();
if (((0, bytes_1.arrayify)(result).length % 32) === 4) {
logger.throwError("resolver threw error", logger_1.Logger.errors.CALL_EXCEPTION, {
transaction: tx, data: result
});
}
if (parseBytes) { if (parseBytes) {
result = _parseBytes(result, 0); result = _parseBytes(result, 0);
} }
@ -380,7 +388,7 @@ var Resolver = /** @class */ (function () {
if (error_1.code === logger_1.Logger.errors.CALL_EXCEPTION) { if (error_1.code === logger_1.Logger.errors.CALL_EXCEPTION) {
return [2 /*return*/, null]; return [2 /*return*/, null];
} }
return [2 /*return*/, null]; throw error_1;
case 5: return [2 /*return*/]; case 5: return [2 /*return*/];
} }
}); });
@ -757,8 +765,6 @@ var BaseProvider = /** @class */ (function (_super) {
} }
_this._maxInternalBlockNumber = -1024; _this._maxInternalBlockNumber = -1024;
_this._lastBlockNumber = -2; _this._lastBlockNumber = -2;
_this._lastFilterBlockNumber = -2;
_this._lastFilterComplete = true;
_this._maxFilterBlockRange = 10; _this._maxFilterBlockRange = 10;
_this._pollingInterval = 4000; _this._pollingInterval = 4000;
_this._fastQueryDate = 0; _this._fastQueryDate = 0;
@ -1040,8 +1046,6 @@ var BaseProvider = /** @class */ (function (_super) {
// First polling cycle // First polling cycle
if (this._lastBlockNumber === -2) { if (this._lastBlockNumber === -2) {
this._lastBlockNumber = blockNumber - 1; this._lastBlockNumber = blockNumber - 1;
this._lastFilterBlockNumber = blockNumber - 1;
this._lastFilterComplete = true;
} }
// Find all transaction hashes we are waiting on // Find all transaction hashes we are waiting on
this._events.forEach(function (event) { this._events.forEach(function (event) {
@ -1061,14 +1065,14 @@ var BaseProvider = /** @class */ (function (_super) {
} }
case "filter": { case "filter": {
// We only allow a single getLogs to be in-flight at a time // We only allow a single getLogs to be in-flight at a time
if (_this._lastFilterComplete) { if (!event._inflight) {
_this._lastFilterComplete = false; event._inflight = true;
// Filter from the last known event; due to load-balancing // Filter from the last known event; due to load-balancing
// and some nodes returning updated block numbers before // and some nodes returning updated block numbers before
// indexing events, a logs result with 0 entries cannot be // indexing events, a logs result with 0 entries cannot be
// trusted and we must retry a range which includes it again // trusted and we must retry a range which includes it again
var filter_1 = event.filter; var filter_1 = event.filter;
filter_1.fromBlock = _this._lastFilterBlockNumber + 1; filter_1.fromBlock = event._lastBlockNumber + 1;
filter_1.toBlock = blockNumber; filter_1.toBlock = blockNumber;
// Prevent fitler ranges from growing too wild // Prevent fitler ranges from growing too wild
if (filter_1.toBlock - _this._maxFilterBlockRange > filter_1.fromBlock) { if (filter_1.toBlock - _this._maxFilterBlockRange > filter_1.fromBlock) {
@ -1076,15 +1080,15 @@ var BaseProvider = /** @class */ (function (_super) {
} }
var runner = _this.getLogs(filter_1).then(function (logs) { var runner = _this.getLogs(filter_1).then(function (logs) {
// Allow the next getLogs // Allow the next getLogs
_this._lastFilterComplete = true; event._inflight = false;
if (logs.length === 0) { if (logs.length === 0) {
return; return;
} }
logs.forEach(function (log) { logs.forEach(function (log) {
// Only when we get an event for a given block number // Only when we get an event for a given block number
// can we trust the events are indexed // can we trust the events are indexed
if (log.blockNumber > _this._lastFilterBlockNumber) { if (log.blockNumber > event._lastBlockNumber) {
_this._lastFilterBlockNumber = log.blockNumber; event._lastBlockNumber = log.blockNumber;
} }
// Make sure we stall requests to fetch blocks and txs // Make sure we stall requests to fetch blocks and txs
_this._emitted["b:" + log.blockHash] = log.blockNumber; _this._emitted["b:" + log.blockHash] = log.blockNumber;
@ -1094,7 +1098,7 @@ var BaseProvider = /** @class */ (function (_super) {
}).catch(function (error) { }).catch(function (error) {
_this.emit("error", error); _this.emit("error", error);
// Allow another getLogs (the range was not updated) // Allow another getLogs (the range was not updated)
_this._lastFilterComplete = true; event._inflight = false;
}); });
runners.push(runner); runners.push(runner);
} }

File diff suppressed because one or more lines are too long

@ -66,7 +66,7 @@
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"sideEffects": false, "sideEffects": false,
"tarballHash": "0x3037127392cd4f9992b70ddc970bc123ba3554591809b28d678ce6c89a8abd16", "tarballHash": "0x615e44f28981170d7b5073516db9e97d9917cc4cedb3b44bb3b74830238a53f2",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"version": "5.6.0" "version": "5.6.0"
} }

@ -41,16 +41,17 @@ function equals(name, actual, expected) {
} }
function TestContractEvents() { function TestContractEvents() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const data = yield ethers.utils.fetchJson('https://api.ethers.io/api/v1/?action=triggerTest&address=' + contract.address);
console.log('*** Triggered Transaction Hash: ' + data.hash);
contract.on("error", (error) => {
console.log(error);
assert(false);
contract.removeAllListeners();
});
function waitForEvent(eventName, expected) { function waitForEvent(eventName, expected) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
let done = false; let done = false;
contract.on("error", (error) => {
if (done) {
return;
}
done = true;
contract.removeAllListeners();
reject(error);
});
contract.on(eventName, function () { contract.on(eventName, function () {
if (done) { if (done) {
return; return;
@ -75,7 +76,7 @@ function TestContractEvents() {
} }
}); });
} }
return new Promise(function (resolve, reject) { const running = new Promise(function (resolve, reject) {
let p0 = '0x06B5955A67D827CDF91823E3bB8F069e6c89c1D6'; let p0 = '0x06B5955A67D827CDF91823E3bB8F069e6c89c1D6';
let p0_1 = '0x06b5955A67d827CdF91823e3Bb8F069e6C89C1d7'; let p0_1 = '0x06b5955A67d827CdF91823e3Bb8F069e6C89C1d7';
let p1 = 0x42; let p1 = 0x42;
@ -91,6 +92,9 @@ function TestContractEvents() {
resolve(result); resolve(result);
}); });
}); });
const data = yield ethers.utils.fetchJson('https://api.ethers.io/api/v1/?action=triggerTest&address=' + contract.address);
console.log('*** Triggered Transaction Hash: ' + data.hash);
return running;
}); });
} }
describe('Test Contract Objects', function () { describe('Test Contract Objects', function () {

File diff suppressed because one or more lines are too long

@ -75,6 +75,14 @@ function TestContractEvents() {
function waitForEvent(eventName, expected) { function waitForEvent(eventName, expected) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
var done = false; var done = false;
contract.on("error", function (error) {
if (done) {
return;
}
done = true;
contract.removeAllListeners();
reject(error);
});
contract.on(eventName, function () { contract.on(eventName, function () {
if (done) { if (done) {
return; return;
@ -99,34 +107,31 @@ function TestContractEvents() {
} }
}); });
} }
var data; var running, data;
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
case 0: return [4 /*yield*/, ethers_1.ethers.utils.fetchJson('https://api.ethers.io/api/v1/?action=triggerTest&address=' + contract.address)]; case 0:
running = new Promise(function (resolve, reject) {
var p0 = '0x06B5955A67D827CDF91823E3bB8F069e6c89c1D6';
var p0_1 = '0x06b5955A67d827CdF91823e3Bb8F069e6C89C1d7';
var p1 = 0x42;
var p1_1 = 0x43;
return Promise.all([
waitForEvent('Test', [p0, p1]),
waitForEvent('TestP0', [p0, p1]),
waitForEvent('TestP0P1', [p0, p1]),
waitForEvent('TestIndexedString', [{ indexed: true, hash: '0x7c5ea36004851c764c44143b1dcb59679b11c9a68e5f41497f6cf3d480715331' }, p1]),
waitForEvent('TestV2', [{ indexed: true }, [p0, p1]]),
waitForEvent('TestV2Nested', [{ indexed: true }, [p0_1, p1_1, [p0, p1]]]),
]).then(function (result) {
resolve(result);
});
});
return [4 /*yield*/, ethers_1.ethers.utils.fetchJson('https://api.ethers.io/api/v1/?action=triggerTest&address=' + contract.address)];
case 1: case 1:
data = _a.sent(); data = _a.sent();
console.log('*** Triggered Transaction Hash: ' + data.hash); console.log('*** Triggered Transaction Hash: ' + data.hash);
contract.on("error", function (error) { return [2 /*return*/, running];
console.log(error);
(0, assert_1.default)(false);
contract.removeAllListeners();
});
return [2 /*return*/, new Promise(function (resolve, reject) {
var p0 = '0x06B5955A67D827CDF91823E3bB8F069e6c89c1D6';
var p0_1 = '0x06b5955A67d827CdF91823e3Bb8F069e6C89C1d7';
var p1 = 0x42;
var p1_1 = 0x43;
return Promise.all([
waitForEvent('Test', [p0, p1]),
waitForEvent('TestP0', [p0, p1]),
waitForEvent('TestP0P1', [p0, p1]),
waitForEvent('TestIndexedString', [{ indexed: true, hash: '0x7c5ea36004851c764c44143b1dcb59679b11c9a68e5f41497f6cf3d480715331' }, p1]),
waitForEvent('TestV2', [{ indexed: true }, [p0, p1]]),
waitForEvent('TestV2Nested', [{ indexed: true }, [p0_1, p1_1, [p0, p1]]]),
]).then(function (result) {
resolve(result);
});
})];
} }
}); });
}); });

File diff suppressed because one or more lines are too long

@ -37,7 +37,7 @@
"scripts": { "scripts": {
"test": "exit 1" "test": "exit 1"
}, },
"tarballHash": "0xfefda511e15d7e1162c9632b4fb7287fe4217ea074defec50b961a087be653b6", "tarballHash": "0xf85cefbce9a9c5e18aa50766ed52ad6c85b7d46aa315820e7e73181df11202e6",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"version": "5.6.0" "version": "5.6.0"
} }