Skip to content

Commit 87adb5d

Browse files
committed
Adjusts transaction-status parser.
1 parent 119e863 commit 87adb5d

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

transaction-status/src/parse_bpf_loader.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ pub fn parse_bpf_upgradeable_loader(
174174
"additionalBytes": additional_bytes,
175175
"programDataAccount": account_keys[instruction.accounts[0] as usize].to_string(),
176176
"programAccount": account_keys[instruction.accounts[1] as usize].to_string(),
177-
"systemProgram": if instruction.accounts.len() > 3 {
177+
"systemProgram": if instruction.accounts.len() > 2 {
178178
Some(account_keys[instruction.accounts[2] as usize].to_string())
179179
} else {
180180
None
181181
},
182-
"payerAccount": if instruction.accounts.len() > 4 {
182+
"payerAccount": if instruction.accounts.len() > 3 {
183183
Some(account_keys[instruction.accounts[3] as usize].to_string())
184184
} else {
185185
None
@@ -198,6 +198,28 @@ pub fn parse_bpf_upgradeable_loader(
198198
}),
199199
})
200200
}
201+
UpgradeableLoaderInstruction::ExtendProgramChecked { additional_bytes } => {
202+
check_num_bpf_upgradeable_loader_accounts(&instruction.accounts, 3)?;
203+
Ok(ParsedInstructionEnum {
204+
instruction_type: "extendProgramChecked".to_string(),
205+
info: json!({
206+
"additionalBytes": additional_bytes,
207+
"programDataAccount": account_keys[instruction.accounts[0] as usize].to_string(),
208+
"programAccount": account_keys[instruction.accounts[1] as usize].to_string(),
209+
"authority": account_keys[instruction.accounts[2] as usize].to_string(),
210+
"systemProgram": if instruction.accounts.len() > 3 {
211+
Some(account_keys[instruction.accounts[3] as usize].to_string())
212+
} else {
213+
None
214+
},
215+
"payerAccount": if instruction.accounts.len() > 4 {
216+
Some(account_keys[instruction.accounts[4] as usize].to_string())
217+
} else {
218+
None
219+
},
220+
}),
221+
})
222+
}
201223
}
202224
}
203225

0 commit comments

Comments
 (0)