Skip to content

Commit

Permalink
merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ochaloup committed Dec 19, 2023
1 parent 29af921 commit c394167
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
6 changes: 3 additions & 3 deletions src/marinade-state/marinade-state.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export namespace MarinadeStateResponse {
account: PublicKey
itemSize: number
count: number
newAccount: PublicKey
copiedCount: number
reserved1: PublicKey
reserved2: number
}

export interface StakeSystem {
Expand Down Expand Up @@ -87,7 +87,7 @@ export interface MarinadeStateResponse {
minWithdraw: BN
stakingSolCap: BN
emergencyCoolingDown: BN
pauseAuthority: web3.PublicKey
pauseAuthority: PublicKey
paused: boolean
delayedUnstakeFee: MarinadeStateResponse.FeeCents
withdrawStakeAccountFee: MarinadeStateResponse.FeeCents
Expand Down
20 changes: 13 additions & 7 deletions test/setup/globalSetup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import * as TestWorld from '../test-world'
import { fetchMarinadeState, getValidatorRecords } from '../../src'
import { marinadeFinanceProgram } from '../../src/programs/marinade-finance-program'
import { LAMPORTS_PER_SOL, StakeProgram, Transaction } from '@solana/web3.js'
import {
Keypair,
LAMPORTS_PER_SOL,
PublicKey,
StakeProgram,
Transaction,
} from '@solana/web3.js'

require('ts-node/register')

Expand Down Expand Up @@ -105,13 +111,13 @@ export default async (): Promise<void> => {
}

async function createAndDelegateStake(
stakeAccountKeypair: web3.Keypair,
votePubkey: web3.PublicKey,
lamports: number = 42 * web3.LAMPORTS_PER_SOL
stakeAccountKeypair: Keypair,
votePubkey: PublicKey,
lamports: number = 42 * LAMPORTS_PER_SOL
) {
// create a stake account that will be used later in all tests
const tx = new web3.Transaction()
const ixStakeAccount = web3.StakeProgram.createAccount({
const tx = new Transaction()
const ixStakeAccount = StakeProgram.createAccount({
authorized: {
staker: TestWorld.PROVIDER.wallet.publicKey,
withdrawer: TestWorld.PROVIDER.wallet.publicKey,
Expand All @@ -122,7 +128,7 @@ async function createAndDelegateStake(
})
tx.add(ixStakeAccount)
/// delegating stake account to the vote account
const ixDelegate = web3.StakeProgram.delegate({
const ixDelegate = StakeProgram.delegate({
authorizedPubkey: TestWorld.PROVIDER.wallet.publicKey,
stakePubkey: stakeAccountKeypair.publicKey,
votePubkey,
Expand Down
22 changes: 10 additions & 12 deletions test/test-world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ export const STAKE_ACCOUNT: Keypair = Keypair.fromSecretKey(
)

// EHNgTdy16497UC6Eq4pri9WicTwzPEDSj3U4Ge6nMVfr
export const STAKE_ACCOUNT_TO_WITHDRAW: web3.Keypair =
web3.Keypair.fromSecretKey(
new Uint8Array([
146, 213, 168, 194, 197, 182, 98, 74, 198, 138, 199, 171, 114, 229, 74,
71, 248, 98, 187, 168, 237, 65, 224, 211, 214, 171, 205, 10, 22, 95, 103,
128, 197, 89, 188, 173, 45, 161, 99, 206, 234, 23, 24, 32, 235, 19, 255,
72, 224, 137, 72, 42, 71, 129, 22, 126, 255, 66, 205, 84, 246, 238, 233,
141,
])
)
export const STAKE_ACCOUNT_TO_WITHDRAW: Keypair = Keypair.fromSecretKey(
new Uint8Array([
146, 213, 168, 194, 197, 182, 98, 74, 198, 138, 199, 171, 114, 229, 74, 71,
248, 98, 187, 168, 237, 65, 224, 211, 214, 171, 205, 10, 22, 95, 103, 128,
197, 89, 188, 173, 45, 161, 99, 206, 234, 23, 24, 32, 235, 19, 255, 72, 224,
137, 72, 42, 71, 129, 22, 126, 255, 66, 205, 84, 246, 238, 233, 141,
])
)

// 9wmxMQ2TFxYh918RzESjiA1dUXbdRAsXBd12JA1vwWQq
export const SDK_USER = Keypair.fromSecretKey(
Expand Down Expand Up @@ -157,7 +155,7 @@ export async function simulateTransaction(transaction: Transaction) {
}

export async function executeTransaction(
transaction: web3.Transaction,
transaction: Transaction,
signers?: Signer[]
) {
const { executedSlot, blockhash } = await setupTransaction(transaction)
Expand Down Expand Up @@ -190,7 +188,7 @@ export async function executeTransaction(
}
}

async function setupTransaction(transaction: web3.Transaction) {
async function setupTransaction(transaction: Transaction) {
const {
context: { slot: executedSlot },
value: { blockhash },
Expand Down

0 comments on commit c394167

Please sign in to comment.