Skip to content

Commit

Permalink
Fixed events when slicing immutable Result (ethers-io#3765).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent 5bc3313 commit 17cb96f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src.ts/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ async function _emit(contract: BaseContract, event: ContractEventName, args: Arr

const count = sub.listeners.length;
sub.listeners = sub.listeners.filter(({ listener, once }) => {
const passArgs = args.slice();
const passArgs = Array.from(args);
if (payloadFunc) {
passArgs.push(payloadFunc(once ? null: listener));
}
Expand Down

0 comments on commit 17cb96f

Please sign in to comment.