-
Notifications
You must be signed in to change notification settings - Fork 473
Add the transaction-level account index of erroring programs to TransactionError::InstructionError
#6083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add the transaction-level account index of erroring programs to TransactionError::InstructionError
#6083
Changes from all commits
bc73c93
e18cf20
5d401f4
0f963cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ crate-type = ["lib"] | |
name = "solana_compute_budget_instruction" | ||
|
||
[dev-dependencies] | ||
assert_matches = { workspace = true } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this change intended? |
||
bincode = { workspace = true } | ||
criterion = { workspace = true } | ||
rand = { workspace = true } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,8 @@ impl ComputeBudgetInstructionDetails { | |
return Err(TransactionError::InstructionError( | ||
index, | ||
InstructionError::InvalidInstructionData, | ||
None, | ||
None, | ||
)); | ||
} | ||
} else { | ||
|
@@ -153,8 +155,12 @@ impl ComputeBudgetInstructionDetails { | |
} | ||
|
||
fn process_instruction(&mut self, index: u8, instruction: &SVMInstruction) -> Result<()> { | ||
let invalid_instruction_data_error = | ||
TransactionError::InstructionError(index, InstructionError::InvalidInstructionData); | ||
let invalid_instruction_data_error = TransactionError::InstructionError( | ||
index, | ||
InstructionError::InvalidInstructionData, | ||
None, | ||
Some(instruction.program_id_index), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that the |
||
); | ||
let duplicate_instruction_error = TransactionError::DuplicateInstruction(index); | ||
|
||
match try_from_slice_unchecked(instruction.data) { | ||
|
@@ -407,6 +413,8 @@ mod test { | |
let expected_heap_size_err = Err(TransactionError::InstructionError( | ||
3, | ||
InstructionError::InvalidInstructionData, | ||
None, | ||
None, | ||
)); | ||
// invalid: requested_heap_size can't be zero | ||
let instruction_details = ComputeBudgetInstructionDetails { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this. This will disappear when anza-xyz/solana-sdk#74 is released.