* Update tests to demonstrate that program id account info for CPI is optional
* Clean up comments that say that program id account info is required
(cherry picked from commit ec7536faf6)
Co-authored-by: Justin Starry <justin@solana.com>
			
			
This commit is contained in:
		| @@ -7,8 +7,6 @@ use crate::{ | ||||
| /// Notes: | ||||
| /// - RefCell checking can be compute unit expensive, to avoid that expense use | ||||
| ///   `invoke_unchecked` instead, but at your own risk. | ||||
| /// - The program id of the instruction being issued must also be included in | ||||
| ///   `account_infos`. | ||||
| pub fn invoke(instruction: &Instruction, account_infos: &[AccountInfo]) -> ProgramResult { | ||||
|     invoke_signed(instruction, account_infos, &[]) | ||||
| } | ||||
| @@ -19,8 +17,6 @@ pub fn invoke(instruction: &Instruction, account_infos: &[AccountInfo]) -> Progr | ||||
| /// - The missing checks ensured that the invocation doesn't violate the borrow | ||||
| ///   rules of the `AccountInfo` fields that are wrapped in `RefCell`s.  To | ||||
| ///   include the checks call `invoke` instead. | ||||
| /// - The program id of the instruction being issued must also be included in | ||||
| ///   `account_infos`. | ||||
| pub fn invoke_unchecked(instruction: &Instruction, account_infos: &[AccountInfo]) -> ProgramResult { | ||||
|     invoke_signed_unchecked(instruction, account_infos, &[]) | ||||
| } | ||||
| @@ -30,8 +26,6 @@ pub fn invoke_unchecked(instruction: &Instruction, account_infos: &[AccountInfo] | ||||
| /// Notes: | ||||
| /// - RefCell checking can be compute unit expensive, to avoid that expense use | ||||
| ///   `invoke_signed_unchecked` instead, but at your own risk. | ||||
| /// - The program id of the instruction being issued must also be included in | ||||
| ///   `account_infos`. | ||||
| pub fn invoke_signed( | ||||
|     instruction: &Instruction, | ||||
|     account_infos: &[AccountInfo], | ||||
| @@ -63,8 +57,6 @@ pub fn invoke_signed( | ||||
| /// - The missing checks ensured that the invocation doesn't violate the borrow | ||||
| ///   rules of the `AccountInfo` fields that are wrapped in `RefCell`s.  To | ||||
| ///   include the checks call `invoke_signed` instead. | ||||
| /// - The program id of the instruction being issued must also be included in | ||||
| ///   `account_infos`. | ||||
| pub fn invoke_signed_unchecked( | ||||
|     instruction: &Instruction, | ||||
|     account_infos: &[AccountInfo], | ||||
|   | ||||
		Reference in New Issue
	
	Block a user