Skip to content

Commit

Permalink
Add default spl programs to custom ledger
Browse files Browse the repository at this point in the history
  • Loading branch information
bergabman committed Jul 22, 2024
1 parent 5928968 commit f179dd2
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 f179dd2

Please sign in to comment.