solana-test-validator
is basically a full validator run locally.
ProgramTestContext
looks more light-weight.
Does testing through ProgramTestContext
skip any checks compared to solana-test-validator
?
1 Answer
solana-program-test
uses the same runtime as solana-test-validator
, with a few differences:
- solana-program-test gives you a
BanksClient
rather than anRpcClient
, which has a bit less functionality - solana-test-validator constantly moves slots forward, whereas
ProgramTestContext
is locked to a slot until you usewarp_to_slot()
. This means that you have control over time withProgramTestContext
As an on-chain program developer, you don't need to worry about any differences between the two, other than these.