Skip to main content

Questions tagged [solana-program-test]

The tag has no usage guidance.

11 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
1 answer

Changes to runtime's LoadedPrograms between 1.17.6 and versions after in the ProgramTest context

Can someone summarize the changes to how LoadedPrograms work between version 1.17.6 and versions after? The changes have broken my ProgramTest setup and I would like to know if I can recreate it after ...
billy's user avatar
  • 352
2 votes
0 answers

Testing Solana Programs

So I'm looking for a way to write solana smart contract test cases, which crates are used for doing so? Example test cases written in rust would be of great help! I can write smart contracts using ...
Muhammad Ali's user avatar
1 vote
1 answer

How to use spl_token account with solana-program-test crate?

I am trying to write a test with the solana-program-test crate for a solana program. This program makes a CPI to a token program: let ix = Instruction { program_id: *token_program.key, ...
S.Rivas's user avatar
  • 11
1 vote
0 answers

Failed to send transaction: Transaction simulation failed: Error processing Instruction 0: incorrect program id for instruction

In the const sx = await sendAndConfirmTransaction i am getting error const { Connection, Keypair, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionInstruction, ...
Aditya's user avatar
  • 157
1 vote
0 answers

Solana Program Test with installed geyser plugin

For the program I'm writing I need to "fast forward" the validator clock for some of my tests. I noticed that warp_slot is available in solana-program-test however I can't seem to find or ...
Anthony Anderson's user avatar
1 vote
0 answers

Solana 1.17+, what processor should be used when instantiating ProgramTest::new()?

I recently upgraded from Solana 1.14 to 1.17.22 and I'm not able to write rust tests that way I've previously been able to. Specifically, previously, when instantiating ProgramTest::new I've typically ...
Ted's user avatar
  • 11
0 votes
1 answer

Error while trying to use solana_program_test?

i am getting "RpcError(DeadlineExceeded)" all time.
pooria sarkhan's user avatar
0 votes
0 answers

How to add AddressLookupTab1e1111111111111111111111111 to ProgramTest

I am getting this error : [2024-01-07T15:07:17.830011345Z DEBUG solana_runtime::message_processor::stable_log] Program AddressLookupTab1e1111111111111111111111111 invoke [1] [2024-01-07T15:07:17....
datben's user avatar
  • 1
0 votes
0 answers

Implement get_program_accounts using BanksClient

BanksClient doesn't have a get_program_accounts method. Is there a way to mimic it?
KevinH's user avatar
  • 422
0 votes
0 answers

Solana program tests are not running in isolated environment

I am running tests with cargo test-sbf. We have a Global Program State that needs to be created only once the lifetime of program. All the program tests are isolated that means I have to do it in all ...
Sushant Chandla's user avatar
0 votes
1 answer

Is it possible to do getProgramAccounts using ProgramTestContext?

I am trying to speed up my tests by switching from using a local test validator to using ProgramTestContext. This will let me execute multiple tests in parallel where each one has its own instance of ...
itsfarseen's user avatar