eth/tracers: convert 'out of gas' wrapped OOG to 'Out Of Gas'

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2024-09-23 21:04:57 +08:00
parent 564b616163
commit 395c7857b2

View file

@ -54,6 +54,7 @@ var parityErrorMapping = map[string]string{
}
var parityErrorMappingStartingWith = map[string]string{
"out of gas:": "Out of gas", // this will convert OOG wrapped errors, eg `out of gas: not enough gas for reentrancy sentry` to `Out of gas`
"invalid opcode:": "Bad instruction",
"stack underflow": "Stack underflow",
}
@ -370,6 +371,7 @@ func convertErrorToParity(call *flatCallFrame) {
for gethError, parityError := range parityErrorMappingStartingWith {
if strings.HasPrefix(call.Error, gethError) {
call.Error = parityError
break
}
}
}