fix Instruction and CompiledInstruction field names (#4895)

* s/program_ids_index/program_id for Instruction

* s/program_ids_index/program_id_index for CompiledInstruction
This commit is contained in:
TristanDebrunner
2019-07-01 18:34:22 -06:00
committed by GitHub
parent 417066ad30
commit 091999a17e
7 changed files with 16 additions and 20 deletions

View File

@@ -18,7 +18,7 @@ fn compile_instruction(ix: Instruction, keys: &[Pubkey]) -> CompiledInstruction
.collect();
CompiledInstruction {
program_ids_index: position(keys, &ix.program_ids_index),
program_id_index: position(keys, &ix.program_id),
data: ix.data.clone(),
accounts,
}
@@ -118,7 +118,7 @@ fn get_keys(instructions: &[Instruction], payer: Option<&Pubkey>) -> Instruction
fn get_program_ids(instructions: &[Instruction]) -> Vec<Pubkey> {
instructions
.iter()
.map(|ix| ix.program_ids_index)
.map(|ix| ix.program_id)
.unique()
.collect()
}
@@ -205,7 +205,7 @@ impl Message {
pub fn program_ids(&self) -> Vec<&Pubkey> {
self.instructions
.iter()
.map(|ix| &self.account_keys[ix.program_ids_index as usize])
.map(|ix| &self.account_keys[ix.program_id_index as usize])
.collect()
}