Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishnakumarskr committed Mar 27, 2024
1 parent a93b630 commit c9666e7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
26 changes: 14 additions & 12 deletions packages/sdk/tests/claim-yield-and-principal.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Multi user deposit test similar to deposit.spec.ts
import { expect, test } from '@playwright/test';
import { expect, test } from '@playwright/test';
import { config } from 'dotenv';
import { BigNumber, Signer } from 'ethers';

Expand Down Expand Up @@ -96,18 +96,20 @@ test.describe('Claim yield and principal - Fixed', async () => {
];
});

await test.step('Empty custodian', async() => {
await test.step('Empty custodian', async () => {
for (let i = 0; i < vaultAddress.length; i++) {
const vault = await sdkA.getVaultInstance(vaultAddress[i]);
const usdc = await sdkA.getAssetInstance(vaultAddress[i]);
const custodian = await vault.CUSTODIAN();
const custodianBalance = await usdc.balanceOf(custodian);
console.log('custodian balance', custodianBalance.toString());
console.log('signer address', await custodianSigner?.getAddress());
if(custodianBalance.gt(0))
usdc.connect(custodianSigner as Signer).transfer("0xcabE80b332Aa9d900f5e32DF51cb0Bc5b276c556", custodianBalance);
console.log('custodian address', custodian);
console.log('custodian balance', (await usdc.balanceOf(custodian)).toString());
const vault = await sdkA.getVaultInstance(vaultAddress[i]);
const usdc = await sdkA.getAssetInstance(vaultAddress[i]);
const custodian = await vault.CUSTODIAN();
const custodianBalance = await usdc.balanceOf(custodian);
console.log('custodian balance', custodianBalance.toString());
console.log('signer address', await custodianSigner?.getAddress());
if (custodianBalance.gt(0))
usdc
.connect(custodianSigner as Signer)
.transfer('0xcabE80b332Aa9d900f5e32DF51cb0Bc5b276c556', custodianBalance);
console.log('custodian address', custodian);
console.log('custodian balance', (await usdc.balanceOf(custodian)).toString());
}
});

Expand Down
8 changes: 4 additions & 4 deletions packages/sdk/tests/multi-user-deposit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ test.describe('Multi user Interaction - Fixed', async () => {
await whitelist(userAddressB, userBId);
});

await test.step('Empty custodian', async() => {
await test.step('Empty custodian', async () => {
const vault = await sdkA.getVaultInstance(vaultAddress);
const usdc = await sdkA.getAssetInstance(vaultAddress);
const custodian = await vault.CUSTODIAN();
const custodianBalance = await usdc.balanceOf(custodian);
console.log('custodian balance', custodianBalance.toString());
console.log('signer address', await custodianSigner?.getAddress());
usdc.connect(custodianSigner as Signer).transfer("0xcabE80b332Aa9d900f5e32DF51cb0Bc5b276c556", custodianBalance);
usdc.connect(custodianSigner as Signer).transfer('0xcabE80b332Aa9d900f5e32DF51cb0Bc5b276c556', custodianBalance);
console.log('custodian address', custodian);
console.log('custodian balance', (await usdc.balanceOf(custodian)).toString());
});
Expand All @@ -98,9 +98,9 @@ test.describe('Multi user Interaction - Fixed', async () => {
await test.step('MINT USDC for user', async () => {
const vault = await sdkA.getVaultInstance(vaultAddress);
const custodian = await vault.CUSTODIAN();
console.log(custodian)
console.log(custodian);
const usdc = await sdkA.getAssetInstance(vaultAddress);
console.log('custodian balance',custodian, (await usdc.balanceOf(custodian)).toString());
console.log('custodian balance', custodian, (await usdc.balanceOf(custodian)).toString());
const userABalance = await usdc.balanceOf(await (walletSignerA as Signer).getAddress());
const userBBalance = await usdc.balanceOf(await (walletSignerB as Signer).getAddress());
if (userABalance.lt(depositAmount))
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/tests/multi-user-upside-deposit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test.describe('Multi user Interaction - Upside', async () => {

const upsideVault = vaults.data.filter((vault: any) => vault.type === 'fixed_yield_upside');
upsideVault.sort((a: any, b: any) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime());

expect(upsideVault).toBeTruthy();

vaultAddress = upsideVault[upsideVault.length - 1].address;
Expand All @@ -90,14 +90,14 @@ test.describe('Multi user Interaction - Upside', async () => {
await whitelist(userAddressB, userBId);
});

await test.step('Empty custodian', async() => {
await test.step('Empty custodian', async () => {
const vault = await sdkA.getVaultInstance(vaultAddress);
const usdc = await sdkA.getAssetInstance(vaultAddress);
const custodian = await vault.CUSTODIAN();
const custodianBalance = await usdc.balanceOf(custodian);
console.log('custodian balance', custodianBalance.toString());
console.log('signer address', await custodianSigner?.getAddress());
usdc.connect(custodianSigner as Signer).transfer("0xcabE80b332Aa9d900f5e32DF51cb0Bc5b276c556", custodianBalance);
usdc.connect(custodianSigner as Signer).transfer('0xcabE80b332Aa9d900f5e32DF51cb0Bc5b276c556', custodianBalance);
console.log('custodian address', custodian);
console.log('custodian balance', (await usdc.balanceOf(custodian)).toString());
});
Expand Down

0 comments on commit c9666e7

Please sign in to comment.