From 0e49e3892d9b328730430f50ce59ee12d28837e6 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 9 May 2024 11:03:43 +0200 Subject: [PATCH] up --- test/vesting/VestingWallet.recovery.test.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/vesting/VestingWallet.recovery.test.js b/test/vesting/VestingWallet.recovery.test.js index 6a5039c9..63dd5e3b 100644 --- a/test/vesting/VestingWallet.recovery.test.js +++ b/test/vesting/VestingWallet.recovery.test.js @@ -42,13 +42,23 @@ describe('VestingWallet ', function () { unsafeAllow: 'delegatecall', }); + // restricted await expect(this.vesting.connect(this.accounts.other).updateBeneficiary(this.accounts.other.address)) .to.be.revertedWith(`Ownable: caller is not the owner`); + // authorized await expect(this.vesting.connect(this.accounts.admin).updateBeneficiary(this.accounts.user2.address)) .to.emit(this.vesting, 'BeneficiaryUpdate').withArgs(this.accounts.user2.address); - expect(await this.vesting.beneficiary()).to.be.equal(this.accounts.user2.address); + await Promise.all([this.vesting.start(), this.vesting.cliff(), this.vesting.duration(), this.vesting.beneficiary(), this.vesting.owner()]).then( + ([start, cliff, duration, beneficiary, owner]) => { + expect(start).to.be.equal(allocation.start); + expect(cliff).to.be.equal(allocation.cliff); + expect(duration).to.be.equal(allocation.duration); + expect(beneficiary).to.be.equal(this.accounts.user2.address); + expect(owner).to.be.equal(allocation.owner); + } + ); }); }); });