Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
EndowmentCreated event: add name (string) (#379)
Browse files Browse the repository at this point in the history
* EndowmentCreated event: add name (string)

* Update contracts/core/accounts/interfaces/IAccountsEvents.sol

Co-authored-by: Nenad Misic <nenad@angelprotocol.io>

* fix tests

---------

Co-authored-by: Andrey <SovereignAndrey>
Co-authored-by: Nenad Misic <nenad@angelprotocol.io>
  • Loading branch information
SovereignAndrey and Nenad Misic authored Sep 14, 2023
1 parent d6bd545 commit af39b10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/core/accounts/facets/AccountsCreateEndowment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ contract AccountsCreateEndowment is
);
}

emit EndowmentCreated(newEndowId, details.endowType);
emit EndowmentCreated(newEndowId, details.endowType, details.name);
}
}
2 changes: 1 addition & 1 deletion contracts/core/accounts/interfaces/IAccountsEvents.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions test/core/accounts/AccountsCreateEndowment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit af39b10

Please sign in to comment.