Upgradeable programs called same as non-upgradeable (#14239)

* Upgradeable programs called same as non-upgradeable

* nudge
This commit is contained in:
Jack May
2020-12-22 09:26:55 -08:00
committed by GitHub
parent 1b30155dc3
commit ab205b682a
8 changed files with 212 additions and 76 deletions

View File

@@ -2,8 +2,8 @@
//! uses the instruction data provided and all the accounts
use solana_program::{
account_info::AccountInfo, bpf_loader_upgradeable, entrypoint, entrypoint::ProgramResult,
instruction::AccountMeta, instruction::Instruction, program::invoke, pubkey::Pubkey,
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, instruction::AccountMeta,
instruction::Instruction, program::invoke, pubkey::Pubkey,
};
entrypoint!(process_instruction);
@@ -15,13 +15,8 @@ fn process_instruction(
) -> ProgramResult {
let to_call = accounts[0].key;
let infos = accounts;
let last = if bpf_loader_upgradeable::check_id(accounts[0].owner) {
accounts.len() - 1
} else {
accounts.len()
};
let instruction = Instruction {
accounts: accounts[1..last]
accounts: accounts[1..]
.iter()
.map(|acc| AccountMeta {
pubkey: *acc.key,