Skip to content

Commit

Permalink
Adjusts transaction-status parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Aug 5, 2024
1 parent 1285557 commit 7263d96
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions transaction-status/src/parse_bpf_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,41 @@ pub fn parse_bpf_upgradeable_loader(
"additionalBytes": additional_bytes,
"programDataAccount": account_keys[instruction.accounts[0] as usize].to_string(),
"programAccount": account_keys[instruction.accounts[1] as usize].to_string(),
"systemProgram": if instruction.accounts.len() > 3 {
"systemProgram": if instruction.accounts.len() > 2 {
Some(account_keys[instruction.accounts[2] as usize].to_string())
} else {
None
},
"payerAccount": if instruction.accounts.len() > 4 {
"payerAccount": if instruction.accounts.len() > 3 {
Some(account_keys[instruction.accounts[3] as usize].to_string())
} else {
None
},
}),
})
}
UpgradeableLoaderInstruction::ExtendProgramChecked { additional_bytes } => {
check_num_bpf_upgradeable_loader_accounts(&instruction.accounts, 3)?;
Ok(ParsedInstructionEnum {
instruction_type: "extendProgramChecked".to_string(),
info: json!({
"additionalBytes": additional_bytes,
"programDataAccount": account_keys[instruction.accounts[0] as usize].to_string(),
"programAccount": account_keys[instruction.accounts[1] as usize].to_string(),
"authority": account_keys[instruction.accounts[2] as usize].to_string(),
"systemProgram": if instruction.accounts.len() > 3 {
Some(account_keys[instruction.accounts[3] as usize].to_string())
} else {
None
},
"payerAccount": if instruction.accounts.len() > 4 {
Some(account_keys[instruction.accounts[4] as usize].to_string())
} else {
None
},
}),
})
}
}
}

Expand Down

0 comments on commit 7263d96

Please sign in to comment.