Skip to content

Commit

Permalink
chore: remove wrong test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexStefan committed Nov 5, 2024
1 parent fdda87b commit 74d3937
Showing 1 changed file with 0 additions and 50 deletions.
50 changes: 0 additions & 50 deletions test/marinade-finance-instructions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
DirectedStakeSdk,
findVoteRecords,
} from '@marinade.finance/directed-stake-sdk'
import { getAccount } from '@solana/spl-token-3.x'
import { LAMPORTS_PER_SOL } from '@solana/web3.js'

describe('Marinade Finance', () => {
beforeAll(async () => {
Expand Down Expand Up @@ -404,52 +402,4 @@ describe('Marinade Finance', () => {
}
})
})

describe('withdraw stake account', () => {
it('withdraw stake account', async () => {
const config = new MarinadeConfig({
connection: TestWorld.CONNECTION,
publicKey: TestWorld.SDK_USER.publicKey,
})
const marinade = new Marinade(config)
// for a validator could be deposited, it must be activated for at least 2 epochs
// i.e., "error: Deposited stake <pubkey> could not be activated yet. Wait for #2 epoch"
await TestWorld.waitForStakeAccountActivation({
stakeAccount: TestWorld.STAKE_ACCOUNT_TO_WITHDRAW.publicKey,
connection: TestWorld.CONNECTION,
activatedAtLeastFor: 2,
})
const {
transaction: transactionDeposit,
associatedMSolTokenAccountAddress,
} = await marinade.depositStakeAccount(
TestWorld.STAKE_ACCOUNT_TO_WITHDRAW.publicKey
)
await TestWorld.executeTransaction(transactionDeposit)
const msolTokenBefore = await getAccount(
TestWorld.CONNECTION,
associatedMSolTokenAccountAddress
)
const { transaction, splitStakeAccountKeypair } =
await marinade.withdrawStakeAccount(
LAMPORTS_PER_SOL,
TestWorld.STAKE_ACCOUNT_TO_WITHDRAW.publicKey
)
const { executedSlot, executionSlot, err, logs, unitsConsumed } =
await TestWorld.executeTransaction(transaction, [
splitStakeAccountKeypair,
])
expect(err).toBeNull() // no error at simulation
expect(executionSlot).toBeGreaterThanOrEqual(executedSlot)
expect(unitsConsumed).toBeGreaterThan(0) // something has been processed
console.log('Withdraw stake account tx logs:', logs)
const msolTokenAfter = await getAccount(
TestWorld.CONNECTION,
associatedMSolTokenAccountAddress
)
expect(
(msolTokenBefore?.amount - msolTokenAfter?.amount).toString()
).toEqual(LAMPORTS_PER_SOL.toString())
})
})
})

0 comments on commit 74d3937

Please sign in to comment.