This commit is contained in:
cui 2026-07-17 21:53:01 -07:00 committed by GitHub
commit 23ec2dffb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,6 +153,7 @@ const (
VMErrorCodeStackUnderflow VMErrorCodeStackUnderflow
VMErrorCodeStackOverflow VMErrorCodeStackOverflow
VMErrorCodeInvalidOpCode VMErrorCodeInvalidOpCode
VMErrorCodeMaxInitCodeSizeExceeded
// VMErrorCodeUnknown explicitly marks an error as unknown, this is useful when error is converted // 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. // 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 return VMErrorCodeExecutionReverted
case errors.Is(err, ErrMaxCodeSizeExceeded): case errors.Is(err, ErrMaxCodeSizeExceeded):
return VMErrorCodeMaxCodeSizeExceeded return VMErrorCodeMaxCodeSizeExceeded
case errors.Is(err, ErrMaxInitCodeSizeExceeded):
return VMErrorCodeMaxInitCodeSizeExceeded
case errors.Is(err, ErrInvalidJump): case errors.Is(err, ErrInvalidJump):
return VMErrorCodeInvalidJump return VMErrorCodeInvalidJump
case errors.Is(err, ErrWriteProtection): case errors.Is(err, ErrWriteProtection):