Direct entrypoint for execution (#7746)
This commit is contained in:
		@@ -113,6 +113,12 @@ pub fn next_keyed_account<I: Iterator>(iter: &mut I) -> Result<I::Item, Instruct
 | 
			
		||||
    iter.next().ok_or(InstructionError::NotEnoughAccountKeys)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Return true if the first keyed_account is executable, used to determine if
 | 
			
		||||
/// the loader should call a program's 'main'
 | 
			
		||||
pub fn is_executable(keyed_accounts: &[KeyedAccount]) -> bool {
 | 
			
		||||
    !keyed_accounts.is_empty() && keyed_accounts[0].account.executable
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub fn limited_deserialize<T>(data: &[u8]) -> Result<T, InstructionError>
 | 
			
		||||
where
 | 
			
		||||
    T: serde::de::DeserializeOwned,
 | 
			
		||||
 
 | 
			
		||||
@@ -24,14 +24,6 @@ pub enum LoaderInstruction {
 | 
			
		||||
    ///
 | 
			
		||||
    /// The transaction must be signed by key[0]
 | 
			
		||||
    Finalize,
 | 
			
		||||
 | 
			
		||||
    /// Invoke the "main" entrypoint with the given data.
 | 
			
		||||
    ///
 | 
			
		||||
    /// * key[0] - an executable account
 | 
			
		||||
    InvokeMain {
 | 
			
		||||
        #[serde(with = "serde_bytes")]
 | 
			
		||||
        data: Vec<u8>,
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub fn write(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user