Refactor CPI, add tests and sprinkle some comments (#28544)
* bpf_loader: cpi: split account update code to update_caller_account and add tests * bpf_loader: cpi: set CallerAccount::original_data_len earlier * cpi: add CallerAccount::from_account_info and CallerAccount::from_sol_account_info * cpi: refactor common account info translation code in translate_account_infos * update_caller docs * cpi: rename translate_accounts to translate_and_update_accounts * cpi: refactor pre-cpi account update code into update_callee_account * cpi: add tests for CallerAccount::from_account_info * cpi: add test for SyscallInvokeSignedRust::translate_accounts * cpi: fix lints * cpi: add test for translate_instruction() * cpi: add test for translate_signers * cpi: fix lint * cpi: review fixups round 1 * cpi: more review fixups Replace ugly MockInvokeContext with a macro * cpi: more review fixes replace get_callee with macro * cpi: more review fixes Add MockAccountInfo::new * Fix rebase mistake
This commit is contained in:
parent
1f40cb3d37
commit
bee24a81b8