Skip to content

Commit

Permalink
[tests] fix hardcoded 1 SOL in tests; failing when init minimumStakeL…
Browse files Browse the repository at this point in the history
…amports is defined
  • Loading branch information
ochaloup committed Sep 10, 2024
1 parent bf58329 commit 7edcc77
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ describe('Validator Bonds fund settlement', () => {
provider,
lamports: LAMPORTS_PER_SOL,
})
const lamportsToFund = maxTotalClaim + LAMPORTS_PER_SOL
const lamportsToFund = maxTotalClaim + stakeAccountMinimalAmount - rentExemptStake

Check failure on line 227 in packages/validator-bonds-sdk/__tests__/bankrun/fundSettlement.spec.ts

View workflow job for this annotation

GitHub Actions / lint-and-test

Insert `⏎·····`
const stakeAccount =
await createBondsFundedStakeAccountActivated(lamportsToFund)

Expand Down Expand Up @@ -404,6 +404,7 @@ describe('Validator Bonds fund settlement', () => {
const { stakeAccount, staker, withdrawer } = await delegatedStakeAccount({
provider,
voteAccountToDelegate: voteAccount,
lamports: stakeAccountMinimalAmount + 1

Check failure on line 407 in packages/validator-bonds-sdk/__tests__/bankrun/fundSettlement.spec.ts

View workflow job for this annotation

GitHub Actions / lint-and-test

Insert `,`
})
const deactivateIx = StakeProgram.deactivate({
stakePubkey: stakeAccount,
Expand Down Expand Up @@ -441,8 +442,8 @@ describe('Validator Bonds fund settlement', () => {
instruction
)
const settlementData = await getSettlement(program, settlementAccount)
// nothing funded as the lamports of the stake account is exactly min lamports for stake account (1 SOL) + rent exempt
expect(settlementData.lamportsFunded).toEqual(0)
// funded only 1 lamport; the lamports of the stake account is min lamports + rent exempt + 1 lamport
expect(settlementData.lamportsFunded).toEqual(1)
await assertNotExist(provider, pubkey(splitStakeAccount))
stakeAccountInfo = await provider.connection.getAccountInfo(stakeAccount)
stakeAccountData = deserializeStakeState(stakeAccountInfo?.data)
Expand Down

0 comments on commit 7edcc77

Please sign in to comment.