Fixed Contract events for immutable Result.
This commit is contained in:
parent
75abc0e5f6
commit
092ce9bcc2
@ -764,7 +764,7 @@ export class Contract {
|
|||||||
if (!this._wrappedEmits[runningEvent.tag]) {
|
if (!this._wrappedEmits[runningEvent.tag]) {
|
||||||
const wrappedEmit = (log: Log) => {
|
const wrappedEmit = (log: Log) => {
|
||||||
const event = this._wrapEvent(runningEvent, log, listener);
|
const event = this._wrapEvent(runningEvent, log, listener);
|
||||||
const args = (event.args || []);
|
const args = (event.args || []).slice();
|
||||||
args.push(event);
|
args.push(event);
|
||||||
this.emit(runningEvent.filter, ...args);
|
this.emit(runningEvent.filter, ...args);
|
||||||
};
|
};
|
||||||
|
@ -58,9 +58,9 @@ function TestContractEvents() {
|
|||||||
done = true;
|
done = true;
|
||||||
|
|
||||||
let args = Array.prototype.slice.call(arguments);
|
let args = Array.prototype.slice.call(arguments);
|
||||||
let event = args.pop();
|
let event = args[args.length - 1];
|
||||||
event.removeListener();
|
event.removeListener();
|
||||||
equals(event.event, args, expected);
|
equals(event.event, args.slice(0, args.length - 1), expected);
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user