Pass the correct program_id to programs (#8630)

This commit is contained in:
Jack May
2020-03-05 10:57:35 -08:00
committed by GitHub
parent 97c5fb8141
commit 5e3ce30d02
6 changed files with 45 additions and 25 deletions

View File

@@ -83,7 +83,7 @@ fn library_open(path: &PathBuf) -> std::io::Result<Library> {
}
pub fn invoke_entrypoint(
program_id: &Pubkey,
_program_id: &Pubkey,
keyed_accounts: &[KeyedAccount],
instruction_data: &[u8],
symbol_cache: &SymbolCache,
@@ -94,7 +94,7 @@ pub fn invoke_entrypoint(
let name_vec = &program.try_account_ref()?.data;
if let Some(entrypoint) = symbol_cache.read().unwrap().get(name_vec) {
unsafe {
return entrypoint(program_id, params, instruction_data);
return entrypoint(names[0].unsigned_key(), params, instruction_data);
}
}
let name = match str::from_utf8(name_vec) {
@@ -120,7 +120,7 @@ pub fn invoke_entrypoint(
return Err(NativeLoaderError::EntrypointNotFound.into());
}
};
let ret = entrypoint(program_id, params, instruction_data);
let ret = entrypoint(names[0].unsigned_key(), params, instruction_data);
symbol_cache
.write()
.unwrap()