File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,13 +57,18 @@ impl StakeTestContext {
5757 StakeAccountBuilder { lifecycle }
5858 }
5959
60- /// Process an instruction
61- pub fn process_with (
60+ /// Process an instruction with account data provided as a slice of (pubkey, data) pairs.
61+ /// Sysvars are auto-resolved - only provide data for accounts that need it.
62+ pub fn process < ' b > (
6263 & self ,
6364 instruction : Instruction ,
64- accounts : Vec < ( Pubkey , AccountSharedData ) > ,
65- ) -> InstructionExecution {
66- InstructionExecution :: new ( instruction, accounts, self )
65+ accounts : & [ ( & Pubkey , & AccountSharedData ) ] ,
66+ ) -> InstructionExecution < ' _ , ' b > {
67+ let accounts_vec = accounts
68+ . iter ( )
69+ . map ( |( pk, data) | ( * * pk, ( * data) . clone ( ) ) )
70+ . collect ( ) ;
71+ InstructionExecution :: new ( instruction, accounts_vec, self )
6772 }
6873
6974 /// Process an instruction with optional missing signer testing
You can’t perform that action at this time.
0 commit comments