Explorer: Show simulation error for Upgrade instruction with none existing buffer (#18838)

This commit is contained in:
Sebastian Bor 2021-07-22 16:28:04 +01:00 committed by GitHub
parent 7d56fa8363
commit 2f3df8cce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -247,6 +247,15 @@ function useSimulator(message: Message) {
}
});
// If the instruction's simulation returned an error without any logs then add an empty log entry for Runtime error
// For example BpfUpgradableLoader fails without returning any logs for Upgrade instruction with buffer that doesn't exist
if (instructionError && instructionLogs.length === 0) {
instructionLogs.push({
logs: [],
failed: true,
});
}
if (
instructionError &&
instructionError.index === instructionLogs.length - 1