addressing review

This commit is contained in:
Jeromy 2020-03-26 20:13:32 -07:00
parent 1b50be09af
commit 672956af5d
2 changed files with 3 additions and 6 deletions

View File

@ -30,7 +30,7 @@ func init() {
var EmptyObjectCid cid.Cid
// Creates account actors from only BLS/SECP256K1 addresses.
func TryCreateAccountActor(ctx context.Context, rt *Runtime, addr address.Address) (*types.Actor, aerrors.ActorError) {
func TryCreateAccountActor(rt *Runtime, addr address.Address) (*types.Actor, aerrors.ActorError) {
addrID, err := rt.state.RegisterNewAddress(addr)
if err != nil {
return nil, aerrors.Absorb(err, byte(exitcode.SysErrInternal), "registering actor address")

View File

@ -210,15 +210,12 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime,
}()
}
aerr := rt.chargeGasSafe(rt.Pricelist().OnMethodInvocation(msg.Value, msg.Method))
if aerr != nil {
return nil, aerr, rt
}
rt.ChargeGas(rt.Pricelist().OnMethodInvocation(msg.Value, msg.Method))
toActor, err := st.GetActor(msg.To)
if err != nil {
if xerrors.Is(err, init_.ErrAddressNotFound) {
a, err := TryCreateAccountActor(ctx, rt, msg.To)
a, err := TryCreateAccountActor(rt, msg.To)
if err != nil {
return nil, aerrors.Absorb(err, 1, "could not create account"), rt
}