Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect event emission on acceptSwap #194 #196

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/Swaplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ contract Swaplace is SwapFactory, ISwaplace, IERC165 {
}
}

emit SwapAccepted(swapId, swap.owner, allowed);
emit SwapAccepted(swapId, swap.owner, msg.sender);

return true;
}
Expand Down
18 changes: 15 additions & 3 deletions test/TestSwaplace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ describe("Swaplace", async function () {
),
)
.to.emit(Swaplace, "SwapAccepted")
.withArgs(await Swaplace.totalSwaps(), owner.address, zeroAddress);
.withArgs(
await Swaplace.totalSwaps(),
owner.address,
allowed.address,
);
});

it("Should be able to {acceptSwap} as N-N Swap", async function () {
Expand Down Expand Up @@ -309,7 +313,11 @@ describe("Swaplace", async function () {
),
)
.to.emit(Swaplace, "SwapAccepted")
.withArgs(await Swaplace.totalSwaps(), owner.address, zeroAddress);
.withArgs(
await Swaplace.totalSwaps(),
owner.address,
allowed.address,
);
});

it("Should be able to {acceptSwap} as P2P Swap", async function () {
Expand Down Expand Up @@ -358,7 +366,11 @@ describe("Swaplace", async function () {
),
)
.to.emit(Swaplace, "SwapAccepted")
.withArgs(await Swaplace.totalSwaps(), owner.address, zeroAddress);
.withArgs(
await Swaplace.totalSwaps(),
owner.address,
allowed.address,
);

await expect(
Swaplace.connect(allowed).acceptSwap(
Expand Down
Loading