mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
core/vm: map ErrMaxInitCodeSizeExceeded to VM error code
ErrMaxInitCodeSizeExceeded was not mapped in vmErrorCodeFromErr, so VMErrorFromErr reported VMErrorCodeUnknown for initcode size violations.
This commit is contained in:
parent
7e625dd548
commit
e5360e0f70
1 changed files with 3 additions and 0 deletions
|
|
@ -153,6 +153,7 @@ const (
|
|||
VMErrorCodeStackUnderflow
|
||||
VMErrorCodeStackOverflow
|
||||
VMErrorCodeInvalidOpCode
|
||||
VMErrorCodeMaxInitCodeSizeExceeded
|
||||
|
||||
// VMErrorCodeUnknown explicitly marks an error as unknown, this is useful when error is converted
|
||||
// from an actual `error` in which case if the mapping is not known, we can use this value to indicate that.
|
||||
|
|
@ -175,6 +176,8 @@ func vmErrorCodeFromErr(err error) int {
|
|||
return VMErrorCodeExecutionReverted
|
||||
case errors.Is(err, ErrMaxCodeSizeExceeded):
|
||||
return VMErrorCodeMaxCodeSizeExceeded
|
||||
case errors.Is(err, ErrMaxInitCodeSizeExceeded):
|
||||
return VMErrorCodeMaxInitCodeSizeExceeded
|
||||
case errors.Is(err, ErrInvalidJump):
|
||||
return VMErrorCodeInvalidJump
|
||||
case errors.Is(err, ErrWriteProtection):
|
||||
|
|
|
|||
Loading…
Reference in a new issue