From b34587fcaa1fbb4101c9e696365fff51a8a7ee1b Mon Sep 17 00:00:00 2001 From: max Date: Fri, 11 Aug 2023 11:02:44 +0100 Subject: [PATCH] added tests --- .../modules/core/PoolModuleOwnership.test.ts | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/protocol/synthetix/test/integration/modules/core/PoolModuleOwnership.test.ts b/protocol/synthetix/test/integration/modules/core/PoolModuleOwnership.test.ts index 179a5fd223..6e4ee31be3 100644 --- a/protocol/synthetix/test/integration/modules/core/PoolModuleOwnership.test.ts +++ b/protocol/synthetix/test/integration/modules/core/PoolModuleOwnership.test.ts @@ -7,7 +7,7 @@ import { ethers } from 'ethers'; import { bootstrapWithMockMarketAndPool } from '../../bootstrap'; import { verifyUsesFeatureFlag } from '../../verifications'; -describe('PoolModule Create / Ownership', function () { +describe.only('PoolModule Create / Ownership', function () { const { signers, systems, MockMarket, marketId, poolId, depositAmount } = bootstrapWithMockMarketAndPool(); @@ -75,7 +75,7 @@ describe('PoolModule Create / Ownership', function () { }); }); - describe('when transfering to a new owner', async () => { + describe('when transferring to a new owner', async () => { describe('when attempting to accept before nominating', async () => { it('reverts', async () => { await assertRevert( @@ -196,6 +196,27 @@ describe('PoolModule Create / Ownership', function () { }); }); }); + + describe('when owner renouncing his ownership', async () => { + it('fails when not the owner tries to renounce it', async () => { + await assertRevert( + systems().Core.connect(user2).renouncePoolOwnership(2), + `Unauthorized("${await user2.getAddress()}")`, + systems().Core + ); + }); + it('emits and event', async () => { + await assertEvent( + await systems().Core.connect(user1).renouncePoolOwnership(2), + `PoolOwnershipRenounced(2, "${await user1.getAddress()}")`, + systems().Core + ); + }); + it('pool has no owner', async () => { + await systems().Core.getPoolOwner(2); + assert.equal(await systems().Core.getPoolOwner(2), ethers.constants.AddressZero); + }); + }); }); });