Move rt.Message fixes behind fork logic
This commit is contained in:
parent
757aa1039f
commit
d9fad5fad0
@ -50,7 +50,7 @@ func (m *Message) ValueReceived() abi.TokenAmount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Runtime struct {
|
type Runtime struct {
|
||||||
Message
|
rt0.Message
|
||||||
rt0.Syscalls
|
rt0.Syscalls
|
||||||
|
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
|
@ -131,10 +131,15 @@ func (vm *VM) makeRuntime(ctx context.Context, msg *types.Message, origin addres
|
|||||||
rt.Abortf(exitcode.SysErrInvalidReceiver, "resolve msg.From address failed")
|
rt.Abortf(exitcode.SysErrInvalidReceiver, "resolve msg.From address failed")
|
||||||
}
|
}
|
||||||
vmm.From = resF
|
vmm.From = resF
|
||||||
resT, _ := rt.ResolveAddress(msg.To)
|
|
||||||
// may be set to undef if recipient doesn't exist yet
|
if vm.ntwkVersion(ctx, vm.blockHeight) <= network.Version3 {
|
||||||
vmm.To = resT
|
rt.Message = &vmm
|
||||||
rt.Message = Message{msg: vmm}
|
} else {
|
||||||
|
resT, _ := rt.ResolveAddress(msg.To)
|
||||||
|
// may be set to undef if recipient doesn't exist yet
|
||||||
|
vmm.To = resT
|
||||||
|
rt.Message = &Message{msg: vmm}
|
||||||
|
}
|
||||||
|
|
||||||
return rt
|
return rt
|
||||||
}
|
}
|
||||||
@ -265,15 +270,19 @@ func (vm *VM) send(ctx context.Context, msg *types.Message, parent *Runtime,
|
|||||||
return nil, aerrors.Wrapf(err, "could not create account")
|
return nil, aerrors.Wrapf(err, "could not create account")
|
||||||
}
|
}
|
||||||
toActor = a
|
toActor = a
|
||||||
nmsg := Message{
|
if vm.ntwkVersion(ctx, vm.blockHeight) <= network.Version3 {
|
||||||
msg: types.Message{
|
// Leave the rt.Message as is
|
||||||
To: aid,
|
} else {
|
||||||
From: rt.Message.Caller(),
|
nmsg := Message{
|
||||||
Value: rt.Message.ValueReceived(),
|
msg: types.Message{
|
||||||
},
|
To: aid,
|
||||||
}
|
From: rt.Message.Caller(),
|
||||||
|
Value: rt.Message.ValueReceived(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
rt.Message = nmsg
|
rt.Message = &nmsg
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return nil, aerrors.Escalate(err, "getting actor")
|
return nil, aerrors.Escalate(err, "getting actor")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user