From 738569af069e204de12e27090165f95bb62938f8 Mon Sep 17 00:00:00 2001 From: Deepu Date: Fri, 9 Feb 2024 23:16:57 +0530 Subject: [PATCH] closes #194 --- contracts/Swaplace.sol | 2 +- test/TestSwaplace.test.ts | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/contracts/Swaplace.sol b/contracts/Swaplace.sol index 4df0283..e5ecb00 100644 --- a/contracts/Swaplace.sol +++ b/contracts/Swaplace.sol @@ -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; } diff --git a/test/TestSwaplace.test.ts b/test/TestSwaplace.test.ts index 3065cd0..68c5b2a 100644 --- a/test/TestSwaplace.test.ts +++ b/test/TestSwaplace.test.ts @@ -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 () { @@ -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 () { @@ -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(