Merge native programs parts into one unit (#7047)

This commit is contained in:
Jack May
2019-11-20 10:12:43 -08:00
committed by GitHub
parent 42da1ce4e2
commit d184d3a732
71 changed files with 244 additions and 335 deletions

View File

@@ -89,8 +89,11 @@ pub fn invoke_entrypoint(
let path = create_path(&name);
match library_open(&path) {
Ok(library) => unsafe {
let entrypoint: Symbol<instruction_processor_utils::Entrypoint> =
match library.get(instruction_processor_utils::ENTRYPOINT.as_bytes()) {
let entrypoint: Symbol<instruction_processor_utils::Entrypoint> = match library
.get(name.as_bytes())
{
Ok(s) => s,
Err(_) => match library.get(instruction_processor_utils::ENTRYPOINT.as_bytes()) {
Ok(s) => s,
Err(e) => {
warn!(
@@ -100,7 +103,8 @@ pub fn invoke_entrypoint(
);
return Err(InstructionError::GenericError);
}
};
},
};
let ret = entrypoint(program_id, params, ix_data);
symbol_cache
.write()