Skip to content

Conversation

@L0STE
Copy link
Contributor

@L0STE L0STE commented Nov 3, 2025

This crate simplifies testing by fetching and storing mainnet accounts directly in the AccountStore.

Key Features

The new RpcAccountStore allows you to:

  • Pass mock accounts using the with_accounts method
  • Fetch mainnet accounts from instructions using the from_instruction method to automatically dump all accounts referenced in an instruction
  • Handle missing accounts gracefully with the allow_missing_accounts method, which stores them with default values
  • Add CPI programs using the add_programs method, which fetches program data from the account store and loads it via mollusk.add_program_with_elf_and_loader (supports both loader V2 and V3)
  • Sync slots with mainnet using with_synced_slot for oracles that require the current mainnet slot to function correctly

New Harness

Added a new test harness variant with *_with_context methods that implement all the above helpers. These methods support both strict and non-strict modes depending on how they're called, while maintaining the same interface as the original harness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant