From af39b10a2d76e8585d33a5bfabf5dc762e4704a1 Mon Sep 17 00:00:00 2001 From: SovereignAndrey <85138450+SovereignAndrey@users.noreply.github.com> Date: Thu, 14 Sep 2023 05:41:29 +0000 Subject: [PATCH] EndowmentCreated event: add name (string) (#379) * EndowmentCreated event: add name (string) * Update contracts/core/accounts/interfaces/IAccountsEvents.sol Co-authored-by: Nenad Misic * fix tests --------- Co-authored-by: Andrey Co-authored-by: Nenad Misic --- contracts/core/accounts/facets/AccountsCreateEndowment.sol | 2 +- contracts/core/accounts/interfaces/IAccountsEvents.sol | 2 +- test/core/accounts/AccountsCreateEndowment.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contracts/core/accounts/facets/AccountsCreateEndowment.sol b/contracts/core/accounts/facets/AccountsCreateEndowment.sol index 07a557088..4af3c9bee 100644 --- a/contracts/core/accounts/facets/AccountsCreateEndowment.sol +++ b/contracts/core/accounts/facets/AccountsCreateEndowment.sol @@ -129,6 +129,6 @@ contract AccountsCreateEndowment is ); } - emit EndowmentCreated(newEndowId, details.endowType); + emit EndowmentCreated(newEndowId, details.endowType, details.name); } } diff --git a/contracts/core/accounts/interfaces/IAccountsEvents.sol b/contracts/core/accounts/interfaces/IAccountsEvents.sol index 8fe907ae7..0bc2bb2a7 100644 --- a/contracts/core/accounts/interfaces/IAccountsEvents.sol +++ b/contracts/core/accounts/interfaces/IAccountsEvents.sol @@ -14,7 +14,7 @@ interface IAccountsEvents { uint256 added, uint256 deducted ); - event EndowmentCreated(uint256 endowId, LibAccounts.EndowmentType endowType); + event EndowmentCreated(uint256 endowId, LibAccounts.EndowmentType endowType, string name); event EndowmentUpdated(uint256 endowId); event EndowmentClosed(uint256 endowId, LibAccounts.Beneficiary beneficiary, uint32[] relinked); event EndowmentDeposit( diff --git a/test/core/accounts/AccountsCreateEndowment.ts b/test/core/accounts/AccountsCreateEndowment.ts index f867aeae2..0b7ddd0e6 100644 --- a/test/core/accounts/AccountsCreateEndowment.ts +++ b/test/core/accounts/AccountsCreateEndowment.ts @@ -307,7 +307,7 @@ describe("AccountsCreateEndowment", function () { await expect(facet.connect(charityApplications).createEndowment(request)) .to.emit(facet, "EndowmentCreated") - .withArgs(expectedNextAccountId, request.endowType); + .withArgs(expectedNextAccountId, request.endowType, request.name); const result = await state.getEndowmentDetails(expectedNextAccountId); @@ -400,7 +400,7 @@ describe("AccountsCreateEndowment", function () { await expect(facet.connect(charityApplications).createEndowment(request)) .to.emit(facet, "EndowmentCreated") - .withArgs(expectedNextAccountId, 0); + .withArgs(expectedNextAccountId, 0, request.name); const result = await state.getEndowmentDetails(expectedNextAccountId);