@ethersproject/contracts
Advanced tools
Comparing version 5.0.0-beta.149 to 5.0.0-beta.150
@@ -1,1 +0,1 @@ | ||
export declare const version = "contracts/5.0.0-beta.149"; | ||
export declare const version = "contracts/5.0.0-beta.150"; |
@@ -1,1 +0,1 @@ | ||
export const version = "contracts/5.0.0-beta.149"; | ||
export const version = "contracts/5.0.0-beta.150"; |
@@ -11,3 +11,3 @@ "use strict"; | ||
}; | ||
import { Indexed, Interface } from "@ethersproject/abi"; | ||
import { checkResultErrors, Indexed, Interface } from "@ethersproject/abi"; | ||
import { Provider } from "@ethersproject/abstract-provider"; | ||
@@ -72,3 +72,3 @@ import { Signer, VoidSigner } from "@ethersproject/abstract-signer"; | ||
if (!allowedTransactionKeys[key]) { | ||
logger.throwError(("unknown transaction override - " + key), "overrides", tx); | ||
logger.throwArgumentError(("unknown transaction override - " + key), "overrides", tx); | ||
} | ||
@@ -285,6 +285,9 @@ } | ||
event.decodeError = error; | ||
throw error; | ||
} | ||
} | ||
getEmit(event) { | ||
const errors = checkResultErrors(event.args); | ||
if (errors.length) { | ||
throw errors[0].error; | ||
} | ||
const args = (event.args || []).slice(); | ||
@@ -522,2 +525,6 @@ args.push(event); | ||
} | ||
// Listen for any event that is registered | ||
if (eventName === "event") { | ||
return this._normalizeRunningEvent(new RunningEvent("event", null)); | ||
} | ||
// Listen for any event | ||
@@ -587,13 +594,21 @@ if (eventName === "*") { | ||
const wrappedEmit = (log) => { | ||
let event = null; | ||
try { | ||
event = this._wrapEvent(runningEvent, log, listener); | ||
let event = this._wrapEvent(runningEvent, log, listener); | ||
// Try to emit the result for the parameterized event... | ||
if (event.decodeError == null) { | ||
try { | ||
const args = runningEvent.getEmit(event); | ||
this.emit(runningEvent.filter, ...args); | ||
} | ||
catch (error) { | ||
event.decodeError = error.error; | ||
} | ||
} | ||
catch (error) { | ||
// There was an error decoding the data and topics | ||
this.emit("error", error, event); | ||
return; | ||
// Always emit "event" for fragment-base events | ||
if (runningEvent.filter != null) { | ||
this.emit("event", event); | ||
} | ||
const args = runningEvent.getEmit(event); | ||
this.emit(runningEvent.filter, ...args); | ||
// Emit "error" if there was an error | ||
if (event.decodeError != null) { | ||
this.emit("error", event.decodeError, event); | ||
} | ||
}; | ||
@@ -600,0 +615,0 @@ this._wrappedEmits[runningEvent.tag] = wrappedEmit; |
@@ -1,1 +0,1 @@ | ||
export declare const version = "contracts/5.0.0-beta.149"; | ||
export declare const version = "contracts/5.0.0-beta.150"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = "contracts/5.0.0-beta.149"; | ||
exports.version = "contracts/5.0.0-beta.150"; |
@@ -124,3 +124,3 @@ "use strict"; | ||
if (!allowedTransactionKeys[key]) { | ||
logger.throwError(("unknown transaction override - " + key), "overrides", tx); | ||
logger.throwArgumentError(("unknown transaction override - " + key), "overrides", tx); | ||
} | ||
@@ -345,6 +345,9 @@ } | ||
event.decodeError = error; | ||
throw error; | ||
} | ||
}; | ||
FragmentRunningEvent.prototype.getEmit = function (event) { | ||
var errors = abi_1.checkResultErrors(event.args); | ||
if (errors.length) { | ||
throw errors[0].error; | ||
} | ||
var args = (event.args || []).slice(); | ||
@@ -595,2 +598,6 @@ args.push(event); | ||
} | ||
// Listen for any event that is registered | ||
if (eventName === "event") { | ||
return this._normalizeRunningEvent(new RunningEvent("event", null)); | ||
} | ||
// Listen for any event | ||
@@ -662,13 +669,21 @@ if (eventName === "*") { | ||
var wrappedEmit = function (log) { | ||
var event = null; | ||
try { | ||
event = _this._wrapEvent(runningEvent, log, listener); | ||
var event = _this._wrapEvent(runningEvent, log, listener); | ||
// Try to emit the result for the parameterized event... | ||
if (event.decodeError == null) { | ||
try { | ||
var args = runningEvent.getEmit(event); | ||
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args)); | ||
} | ||
catch (error) { | ||
event.decodeError = error.error; | ||
} | ||
} | ||
catch (error) { | ||
// There was an error decoding the data and topics | ||
_this.emit("error", error, event); | ||
return; | ||
// Always emit "event" for fragment-base events | ||
if (runningEvent.filter != null) { | ||
_this.emit("event", event); | ||
} | ||
var args = runningEvent.getEmit(event); | ||
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args)); | ||
// Emit "error" if there was an error | ||
if (event.decodeError != null) { | ||
_this.emit("error", event.decodeError, event); | ||
} | ||
}; | ||
@@ -675,0 +690,0 @@ this._wrappedEmits[runningEvent.tag] = wrappedEmit; |
@@ -35,5 +35,5 @@ { | ||
}, | ||
"tarballHash": "0x0831bbcb34338804b94a0f9a4d177f00308651b2e40e6648e8d6678299c2f0eb", | ||
"tarballHash": "0x5030e873ef0ebc78913b3a1344a86cd92873b60418a342048ad165f751c342e5", | ||
"types": "./lib/index.d.ts", | ||
"version": "5.0.0-beta.149" | ||
"version": "5.0.0-beta.150" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91795
1983