Skip to content

Commit

Permalink
test: update veBAL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-waite committed Oct 12, 2022
1 parent 12e8bb4 commit 391da85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 43 deletions.
8 changes: 4 additions & 4 deletions test/integration/tests/tribeRedeemer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('e2e-tribe-redeemer', function () {
expect(daiReceived).to.be.at.most('71000000000'); // <>>= 0.0000000710 DAI
});

it.only('dust redeemooor', async () => {
it('dust redeemooor', async () => {
const signer = await getImpersonatedSigner(addresses.core);
await forceEth(signer.address);
const amount = '100'; // 100 TRIBE Wei
Expand All @@ -177,7 +177,7 @@ describe('e2e-tribe-redeemer', function () {
expect(daiReceived).to.be.equal('7'); // 6 DAI Wei
});

it.only('last redeemooor', async () => {
it('last redeemooor', async () => {
const signer = await getImpersonatedSigner(addresses.core);
await forceEth(signer.address);
const redeemerSigner = await getImpersonatedSigner(contracts.tribeRedeemer.address);
Expand Down Expand Up @@ -251,8 +251,8 @@ describe('e2e-tribe-redeemer', function () {
const daiReceived = daiBalance1.sub(daiBalance0);
expect(stethReceived).to.be.at.least(ethers.constants.WeiPerEther.mul(109).div(100)); // 1.0964 stETH
expect(stethReceived).to.be.at.most(ethers.constants.WeiPerEther.mul(112).div(100));
expect(daiReceived).to.be.at.least(ethers.constants.WeiPerEther.mul(665)); // 670.212 DAI
expect(daiReceived).to.be.at.most(ethers.constants.WeiPerEther.mul(675));
expect(daiReceived).to.be.at.least(ethers.constants.WeiPerEther.mul(700)); // 701.525 DAI
expect(daiReceived).to.be.at.most(ethers.constants.WeiPerEther.mul(705));

// balance after all redeems
expect(await contracts.steth.balanceOf(contracts.tribeRedeemer.address)).to.be.at.most('1');
Expand Down
39 changes: 1 addition & 38 deletions test/integration/tests/veBalHelper_gauge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { VeBalHelper } from '@custom-types/contracts';
import { NamedAddresses, NamedContracts } from '@custom-types/types';
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
import { ProposalsConfig } from '@protocol/proposalsConfig';
import { getAddresses, getImpersonatedSigner } from '@test/helpers';
import { getAddresses, getImpersonatedSigner, time } from '@test/helpers';
import { TestEndtoEndCoordinator } from '@test/integration/setup';
import chai, { expect } from 'chai';
import CBN from 'chai-bn';
Expand Down Expand Up @@ -103,41 +103,4 @@ describe('e2e-veBalHelper-gauge-management', function () {
).sub(stakeBeforeBalance);
expect(stakeBalanceDiff).to.equal(0);
});

it('should be able to voteForGaugeWeight() to vote for gauge weights whilst a lock is active ', async () => {
// remove 100% votes for B-30FEI-70WETH
expect(
(
await contracts.balancerGaugeController.vote_user_slopes(
contractAddresses.veBalDelegatorPCVDeposit,
contractAddresses.balancerGaugeBpt30Fei70Weth
)
)[1]
).to.be.equal('10000');
await vebalOtcHelper
.connect(otcBuyerSigner)
.voteForGaugeWeight(contractAddresses.bpt30Fei70Weth, contractAddresses.balancerGaugeBpt30Fei70Weth, 0);
expect(
(
await contracts.balancerGaugeController.vote_user_slopes(
contractAddresses.veBalDelegatorPCVDeposit,
contractAddresses.balancerGaugeBpt30Fei70Weth
)
)[1]
).to.be.equal('0');
// set 100% votes for bb-a-usd
await vebalOtcHelper.connect(otcBuyerSigner).voteForGaugeWeight(
'0x7B50775383d3D6f0215A8F290f2C9e2eEBBEceb2', // bb-a-usd token
'0x68d019f64A7aa97e2D4e7363AEE42251D08124Fb', // bb-a-usd gauge
10000
);
expect(
(
await contracts.balancerGaugeController.vote_user_slopes(
contractAddresses.veBalDelegatorPCVDeposit,
'0x68d019f64A7aa97e2D4e7363AEE42251D08124Fb'
)
)[1]
).to.be.equal('10000');
});
});
2 changes: 1 addition & 1 deletion test/integration/tests/veBalHelper_setters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ describe('e2e-veBalHelper-setters', function () {

it('should be able setDelegate() to give snapshot voting power to another address', async () => {
// Can setDelegate() to give Snapshot voting power to someone else
expect(await contracts.veBalDelegatorPCVDeposit.delegate()).to.be.equal(contractAddresses.eswak);
expect(await contracts.veBalDelegatorPCVDeposit.delegate()).to.be.equal(contractAddresses.aaveCompaniesMultisig);
await vebalOtcHelper.connect(otcBuyerSigner).setDelegate(contractAddresses.feiDAOTimelock);
expect(await contracts.veBalDelegatorPCVDeposit.delegate()).to.be.equal(contractAddresses.feiDAOTimelock);
});
Expand Down

0 comments on commit 391da85

Please sign in to comment.