Merge pull request #4704 from zgfzgf/fix-runtime-gas-print

modify runtime gasUsed printf
This commit is contained in:
Łukasz Magiera 2020-11-03 11:46:26 +01:00 committed by GitHub
commit c215615da3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -546,9 +546,10 @@ func (rt *Runtime) chargeGasInternal(gas GasCharge, skip int) aerrors.ActorError
// overflow safe
if rt.gasUsed > rt.gasAvailable-toUse {
gasUsed := rt.gasUsed
rt.gasUsed = rt.gasAvailable
return aerrors.Newf(exitcode.SysErrOutOfGas, "not enough gas: used=%d, available=%d",
rt.gasUsed, rt.gasAvailable)
return aerrors.Newf(exitcode.SysErrOutOfGas, "not enough gas: used=%d, available=%d, use=%d",
gasUsed, rt.gasAvailable, toUse)
}
rt.gasUsed += toUse
return nil