Skip to content

Commit

Permalink
test: update redeemer tests now OTC DAI is there
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-waite committed Oct 12, 2022
1 parent cf9d4a8 commit 12e8bb4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
3 changes: 3 additions & 0 deletions proposals/dao/tip_123.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ const validate: ValidateUpgradeFunc = async (addresses, oldContracts, contracts,

// 6. Verify can not queue on DAO timelock
await verifyCanNotQueueProposals(contracts, addresses);

// 7. Verify proxyAdmin controlled by DAO timelock
expect(await contracts.proxyAdmin.owner()).to.equal(addresses.feiDAOTimelock);
};

// Verify proposals can not be queued
Expand Down
3 changes: 1 addition & 2 deletions protocol-configuration/mainnetAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ export const MainnetContractsConfig = {
category: AddressCategory.PCV
},

// TODO: Mark as deprecated after DAI moved to Tribe Redeemer
escrowedAaveDaiPCVDeposit: {
artifactName: 'ERC20PCVDepositWrapper',
address: '0x82c55A1Ab5C6F4b8e162b7dE24b50A38E1aFd38f',
category: AddressCategory.PCV
category: AddressCategory.Deprecated
},

// TODO: Mark as deprecated after Rari fuse admin sorted
Expand Down
20 changes: 10 additions & 10 deletions test/integration/tests/tribeRedeemer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ describe('e2e-tribe-redeemer', function () {
expect(amountsOut[1]).to.be.at.most(ethers.constants.WeiPerEther.mul(25));
expect(amountsOut[2]).to.be.at.least(ethers.constants.WeiPerEther.mul(330)); // 333.72 FOX
expect(amountsOut[2]).to.be.at.most(ethers.constants.WeiPerEther.mul(335));
expect(amountsOut[3]).to.be.at.least(ethers.constants.WeiPerEther.mul(665)); // 670.21 DAI
expect(amountsOut[3]).to.be.at.most(ethers.constants.WeiPerEther.mul(675));
expect(amountsOut[3]).to.be.at.least(ethers.constants.WeiPerEther.mul(700)); // 670.21 DAI
expect(amountsOut[3]).to.be.at.most(ethers.constants.WeiPerEther.mul(705));
});

it('redeem() 1,000,000 TRIBE, twice', async () => {
Expand Down Expand Up @@ -119,8 +119,8 @@ describe('e2e-tribe-redeemer', function () {
const daiPerRedeem = daiBalance1.sub(daiBalance0);
expect(stethPerRedeem).to.be.at.least(ethers.constants.WeiPerEther.mul(109));
expect(stethPerRedeem).to.be.at.most(ethers.constants.WeiPerEther.mul(112));
expect(daiPerRedeem).to.be.at.least(ethers.constants.WeiPerEther.mul(66500));
expect(daiPerRedeem).to.be.at.most(ethers.constants.WeiPerEther.mul(67500));
expect(daiPerRedeem).to.be.at.least(ethers.constants.WeiPerEther.mul(70000));
expect(daiPerRedeem).to.be.at.most(ethers.constants.WeiPerEther.mul(71000));
});

it('small redeemooor', async () => {
Expand All @@ -147,11 +147,11 @@ describe('e2e-tribe-redeemer', function () {
const daiReceived = daiBalance1.sub(daiBalance0);
expect(stethReceived).to.be.at.least('109000000'); // >= 0.000000000109 stETH
expect(stethReceived).to.be.at.most('112000000'); // <= 0.000000000112 stETH
expect(daiReceived).to.be.at.least('66500000000'); // >= 0.0000000665 DAI
expect(daiReceived).to.be.at.most('67500000000'); // <>>= 0.0000000675 DAI
expect(daiReceived).to.be.at.least('70000000000'); // >= 0.0000000700 DAI
expect(daiReceived).to.be.at.most('71000000000'); // <>>= 0.0000000710 DAI
});

it('dust redeemooor', async () => {
it.only('dust redeemooor', async () => {
const signer = await getImpersonatedSigner(addresses.core);
await forceEth(signer.address);
const amount = '100'; // 100 TRIBE Wei
Expand All @@ -174,10 +174,10 @@ describe('e2e-tribe-redeemer', function () {
const stethReceived = stethBalance1.sub(stethBalance0);
const daiReceived = daiBalance1.sub(daiBalance0);
expect(stethReceived).to.be.equal('0'); // got rounded down to 0, no revert
expect(daiReceived).to.be.equal('6'); // 6 DAI Wei
expect(daiReceived).to.be.equal('7'); // 6 DAI Wei
});

it('last redeemooor', async () => {
it.only('last redeemooor', async () => {
const signer = await getImpersonatedSigner(addresses.core);
await forceEth(signer.address);
const redeemerSigner = await getImpersonatedSigner(contracts.tribeRedeemer.address);
Expand All @@ -200,7 +200,7 @@ describe('e2e-tribe-redeemer', function () {
const expectedAmounts = {
redeemedAmount: ethers.constants.WeiPerEther.mul(10_000),
steth: ethers.BigNumber.from('1096463758637073656'), // 1.0964 stETH
dai: ethers.BigNumber.from('670212090694599076060') // 670.212 DAI
dai: ethers.BigNumber.from('701525436619890200000') // 701.525 DAI
};
for (let i = 0; i < 10; i++) {
const multiplier = Math.floor(Math.random() * 100) + 1;
Expand Down

0 comments on commit 12e8bb4

Please sign in to comment.