mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
eth/tracers: convert 'out of gas' wrapped OOG to 'Out Of Gas'
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
564b616163
commit
395c7857b2
1 changed files with 2 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ var parityErrorMapping = map[string]string{
|
||||||
}
|
}
|
||||||
|
|
||||||
var parityErrorMappingStartingWith = 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",
|
"invalid opcode:": "Bad instruction",
|
||||||
"stack underflow": "Stack underflow",
|
"stack underflow": "Stack underflow",
|
||||||
}
|
}
|
||||||
|
|
@ -370,6 +371,7 @@ func convertErrorToParity(call *flatCallFrame) {
|
||||||
for gethError, parityError := range parityErrorMappingStartingWith {
|
for gethError, parityError := range parityErrorMappingStartingWith {
|
||||||
if strings.HasPrefix(call.Error, gethError) {
|
if strings.HasPrefix(call.Error, gethError) {
|
||||||
call.Error = parityError
|
call.Error = parityError
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue