Skip to content

Commit

Permalink
Merge pull request #1 from Turbin3/main
Browse files Browse the repository at this point in the history
Add default spl programs to custom ledger
  • Loading branch information
0xPlish authored Jul 24, 2024
2 parents 5928968 + f179dd2 commit fc887ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ solana-client = "=1.18.1"
solana-ledger = "=1.18.1"
solana-runtime = "=1.18.1"
solana-account-decoder = "=1.18.1"
solana-program-test = "=1.18.1"
spl-token = "4.0.0"
serde_json = "1.0.114"
serde = { version = "1.0.197", features = ["derive"] }
Expand Down
6 changes: 6 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ impl Valid8Context {

let mut accounts: HashMap<Pubkey, AccountSharedData> = HashMap::new();



let _ = self.programs
.into_iter()
.map(|pa|{
Expand All @@ -528,6 +530,10 @@ impl Valid8Context {
AccountSharedData::new(faucet_lamports, 0, &system_program::id())
);

for (address, account) in solana_program_test::programs::spl_programs(&Rent::default()) {
accounts.entry(address).or_insert(account);
}

let mut genesis_config = create_genesis_config_with_leader_ex(
mint_lamports,
&mint_address.pubkey(),
Expand Down

0 comments on commit fc887ac

Please sign in to comment.