pass From to Send

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2019-07-16 00:42:37 +02:00
parent be60e28412
commit de18f9c865
3 changed files with 11 additions and 4 deletions

View File

@ -147,4 +147,13 @@ func TestVMInvokeHarness(t *testing.T) {
if act.Code != StorageMinerCodeCid {
t.Fatalf("Expected correct code, got %s, instead of %s", act.Code, StorageMinerCodeCid)
}
hblock, err := h.bs.Get(act.Head)
if err != nil {
t.Fatal(err)
}
smas := &StorageMinerActorState{}
if smas.Owner != h.From {
t.Fatalf("Owner should be %s, but is %s", h.From, smas.Owner)
}
}

View File

@ -66,7 +66,7 @@ var (
)
// UndefAddressString is the string used to represent an empty address when encoded to a string.
var UndefAddressString = "empty"
var UndefAddressString = "<empty>"
// PayloadHashLength defines the hash length taken over addresses using the Actor and SECP256K1 protocols.
const PayloadHashLength = 20

View File

@ -76,6 +76,7 @@ func (vmc *VMContext) Ipld() *hamt.CborIpldStore {
// Send allows the current execution context to invoke methods on other actors in the system
func (vmc *VMContext) Send(to address.Address, method uint64, value types.BigInt, params []byte) ([]byte, uint8, error) {
msg := &types.Message{
From: vmc.msg.From,
To: to,
Method: method,
Value: value,
@ -96,9 +97,6 @@ func (vmc *VMContext) Send(to address.Address, method uint64, value types.BigInt
toAct.Head = nvmctx.Storage().GetHead()
// We need probably copy here the content from sub-vmcontext to this vm-context
// I think, @why??
return res, ret, err
}