From e2a0d58e66087b5a701269a87b0cbc55a2ebffd3 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Mon, 16 Oct 2023 18:01:18 +0100 Subject: [PATCH] Cleanup test --- staking/tests/split_vesting_account.ts | 133 +------------------------ 1 file changed, 1 insertion(+), 132 deletions(-) diff --git a/staking/tests/split_vesting_account.ts b/staking/tests/split_vesting_account.ts index ce33ad9b..be907a08 100644 --- a/staking/tests/split_vesting_account.ts +++ b/staking/tests/split_vesting_account.ts @@ -11,7 +11,7 @@ import path from "path"; import { Keypair, PublicKey, Transaction } from "@solana/web3.js"; import { StakeConnection, PythBalance, VestingAccountState } from "../app"; import { BN, Wallet } from "@project-serum/anchor"; -import { assertBalanceMatches, loadAndUnlock } from "./utils/api_utils"; +import { assertBalanceMatches } from "./utils/api_utils"; import assert from "assert"; const ONE_MONTH = new BN(3600 * 24 * 30.5); @@ -34,7 +34,6 @@ describe("split vesting account", async () => { let samConnection: StakeConnection; let alice = new Keypair(); - let aliceConnection: StakeConnection; before(async () => { const config = readAnchorConfig(ANCHOR_CONFIG_PATH); @@ -140,136 +139,6 @@ describe("split vesting account", async () => { await pdaConnection.acceptSplit(stakeAccount); }); - // it("one month minus 1 later", async () => { - // await samConnection.program.methods - // .advanceClock(ONE_MONTH.sub(EPOCH_DURATION)) - // .rpc(); - - // await assertBalanceMatches( - // samConnection, - // sam.publicKey, - // { - // unvested: { - // locked: PythBalance.fromString("100"), - // }, - // }, - // await samConnection.getTime() - // ); - - // let samStakeAccount = await samConnection.getMainAccount(sam.publicKey); - - // assert( - // VestingAccountState.UnvestedTokensFullyLocked == - // samStakeAccount.getVestingAccountState(await samConnection.getTime()) - // ); - - // await samConnection.depositAndLockTokens( - // samStakeAccount, - // PythBalance.fromString("1") - // ); - - // samStakeAccount = await samConnection.getMainAccount(sam.publicKey); - // assert( - // VestingAccountState.UnvestedTokensFullyLocked == - // samStakeAccount.getVestingAccountState(await samConnection.getTime()) - // ); - // await assertBalanceMatches( - // samConnection, - // sam.publicKey, - // { - // unvested: { - // locked: PythBalance.fromString("100"), - // }, - // locked: { locking: PythBalance.fromString("1") }, - // }, - // await samConnection.getTime() - // ); - // }); - - // it("one month later", async () => { - // await samConnection.program.methods.advanceClock(EPOCH_DURATION).rpc(); - - // let samStakeAccount = await samConnection.getMainAccount(sam.publicKey); - // assert( - // VestingAccountState.UnvestedTokensFullyLocked == - // samStakeAccount.getVestingAccountState(await samConnection.getTime()) - // ); - - // await assertBalanceMatches( - // samConnection, - // sam.publicKey, - // { - // unvested: { - // locked: PythBalance.fromString("98.611112"), - // }, - // locked: { locked: PythBalance.fromString("2.388888") }, - // }, - // await samConnection.getTime() - // ); - - // await samConnection.depositAndLockTokens( - // samStakeAccount, - // PythBalance.fromString("1") - // ); - - // samStakeAccount = await samConnection.getMainAccount(sam.publicKey); - - // assert( - // VestingAccountState.UnvestedTokensFullyLocked == - // samStakeAccount.getVestingAccountState(await samConnection.getTime()) - // ); - - // await assertBalanceMatches( - // samConnection, - // sam.publicKey, - // { - // unvested: { - // locked: PythBalance.fromString("98.611112"), - // }, - // locked: { - // locked: PythBalance.fromString("2.388888"), - // locking: PythBalance.fromString("1"), - // }, - // }, - // await samConnection.getTime() - // ); - - // await loadAndUnlock( - // samConnection, - // sam.publicKey, - // PythBalance.fromString("1") - // ); - - // samStakeAccount = await samConnection.getMainAccount(sam.publicKey); - - // assert( - // VestingAccountState.UnvestedTokensFullyLocked == - // samStakeAccount.getVestingAccountState(await samConnection.getTime()) - // ); - - // await assertBalanceMatches( - // samConnection, - // sam.publicKey, - // { - // unvested: { - // locked: PythBalance.fromString("98.611112"), - // }, - // locked: { - // preunlocking: PythBalance.fromString("1"), - // locked: PythBalance.fromString("1.388888"), - // locking: PythBalance.fromString("1"), - // }, - // }, - // await samConnection.getTime() - // ); - - // assert( - // samStakeAccount - // .getNetExcessGovernanceAtVesting(await samConnection.getTime()) - // .eq(PythBalance.fromString("3.777777").toBN()) - // ); - // }); - after(async () => { controller.abort(); });