@ -67,7 +67,7 @@ fn library_open(path: &PathBuf) -> std::io::Result<Library> {
|
||||
pub fn invoke_entrypoint(
|
||||
program_id: &Pubkey,
|
||||
keyed_accounts: &mut [KeyedAccount],
|
||||
ix_data: &[u8],
|
||||
instruction_data: &[u8],
|
||||
symbol_cache: &SymbolCache,
|
||||
) -> Result<(), InstructionError> {
|
||||
// dispatch it
|
||||
@ -75,7 +75,7 @@ pub fn invoke_entrypoint(
|
||||
let name_vec = &names[0].account.data;
|
||||
if let Some(entrypoint) = symbol_cache.read().unwrap().get(name_vec) {
|
||||
unsafe {
|
||||
return entrypoint(program_id, params, ix_data);
|
||||
return entrypoint(program_id, params, instruction_data);
|
||||
}
|
||||
}
|
||||
let name = match str::from_utf8(name_vec) {
|
||||
@ -101,7 +101,7 @@ pub fn invoke_entrypoint(
|
||||
return Err(InstructionError::GenericError);
|
||||
}
|
||||
};
|
||||
let ret = entrypoint(program_id, params, ix_data);
|
||||
let ret = entrypoint(program_id, params, instruction_data);
|
||||
symbol_cache
|
||||
.write()
|
||||
.unwrap()
|
||||
|
@ -133,10 +133,10 @@ fn finish_create_account(
|
||||
}
|
||||
|
||||
fn assign_account_to_program(
|
||||
account: &mut KeyedAccount,
|
||||
keyed_account: &mut KeyedAccount,
|
||||
program_id: &Pubkey,
|
||||
) -> Result<(), InstructionError> {
|
||||
if account.signer_key().is_none() {
|
||||
if keyed_account.signer_key().is_none() {
|
||||
debug!("Assign: account must sign");
|
||||
return Err(InstructionError::MissingRequiredSignature);
|
||||
}
|
||||
@ -147,7 +147,7 @@ fn assign_account_to_program(
|
||||
return Err(SystemError::InvalidProgramId.into());
|
||||
}
|
||||
|
||||
account.account.owner = *program_id;
|
||||
keyed_account.account.owner = *program_id;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -186,9 +186,9 @@ fn transfer_lamports(
|
||||
pub fn process_instruction(
|
||||
_program_id: &Pubkey,
|
||||
keyed_accounts: &mut [KeyedAccount],
|
||||
data: &[u8],
|
||||
instruction_data: &[u8],
|
||||
) -> Result<(), InstructionError> {
|
||||
let instruction = limited_deserialize(data)?;
|
||||
let instruction = limited_deserialize(instruction_data)?;
|
||||
|
||||
trace!("process_instruction: {:?}", instruction);
|
||||
trace!("keyed_accounts: {:?}", keyed_accounts);
|
||||
|
Reference in New Issue
Block a user