Skip to content

Commit

Permalink
Fixed Contract events for immutable Result.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Mar 31, 2020
1 parent 75abc0e commit 092ce9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/contracts/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ export class Contract {
if (!this._wrappedEmits[runningEvent.tag]) {
const wrappedEmit = (log: Log) => {
const event = this._wrapEvent(runningEvent, log, listener);
const args = (event.args || []);
const args = (event.args || []).slice();
args.push(event);
this.emit(runningEvent.filter, ...args);
};
Expand Down
4 changes: 2 additions & 2 deletions packages/tests/src.ts/test-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ function TestContractEvents() {
done = true;

let args = Array.prototype.slice.call(arguments);
let event = args.pop();
let event = args[args.length - 1];
event.removeListener();
equals(event.event, args, expected);
equals(event.event, args.slice(0, args.length - 1), expected);
resolve();
});

Expand Down

0 comments on commit 092ce9b

Please sign in to comment.