Merge pull request #1467 from filecoin-project/fix/charge-gas

use charge gas safe in places we return errors
This commit is contained in:
Łukasz Magiera 2020-03-27 18:49:03 +01:00 committed by GitHub
commit cba97000c8

View File

@ -210,7 +210,9 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime,
}()
}
rt.ChargeGas(rt.Pricelist().OnMethodInvocation(msg.Value, msg.Method))
if aerr := rt.chargeGasSafe(rt.Pricelist().OnMethodInvocation(msg.Value, msg.Method)); aerr != nil {
return nil, aerrors.Wrap(aerr, "not enough gas for method invocation"), rt
}
toActor, err := st.GetActor(msg.To)
if err != nil {