Skip to content

Commit

Permalink
chore(tracing): return detailed oog message
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa committed Oct 5, 2024
1 parent 34f8b07 commit 7814137
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/tracing/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,27 @@ impl CallTrace {
InstructionResult::Revert => {
if kind.is_parity() { "Reverted" } else { "execution reverted" }.to_string()
}
InstructionResult::OutOfGas | InstructionResult::MemoryOOG => {
InstructionResult::OutOfGas | InstructionResult::PrecompileOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas" }.to_string()
}
InstructionResult::MemoryOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas: out of memory" }
.to_string()
}
InstructionResult::MemoryLimitOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas: reach memory limit" }
.to_string()
}
InstructionResult::InvalidOperandOOG => {
if kind.is_parity() { "Out of gas" } else { "out of gas: invalid operand" }
.to_string()
}
InstructionResult::ReentrancySentryOOG => if kind.is_parity() {
"Out of gas"
} else {
"out of gas: not enough gas for reentrancy sentry"
}
.to_string(),
InstructionResult::OpcodeNotFound => {
if kind.is_parity() { "Bad instruction" } else { "invalid opcode" }.to_string()
}
Expand Down

0 comments on commit 7814137

Please sign in to comment.