addressing review
This commit is contained in:
parent
1b50be09af
commit
672956af5d
@ -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")
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user