From de18f9c8656a574b8b96283bf153d1c7d776387f Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 16 Jul 2019 00:42:37 +0200 Subject: [PATCH] pass From to Send License: MIT Signed-off-by: Jakub Sztandera --- chain/actors/harness_test.go | 9 +++++++++ chain/address/constants.go | 2 +- chain/vm.go | 4 +--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/chain/actors/harness_test.go b/chain/actors/harness_test.go index 0b3584cbb..bf1853b03 100644 --- a/chain/actors/harness_test.go +++ b/chain/actors/harness_test.go @@ -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) + } } diff --git a/chain/address/constants.go b/chain/address/constants.go index 641386886..1da2488c3 100644 --- a/chain/address/constants.go +++ b/chain/address/constants.go @@ -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 = "" // PayloadHashLength defines the hash length taken over addresses using the Actor and SECP256K1 protocols. const PayloadHashLength = 20 diff --git a/chain/vm.go b/chain/vm.go index 112fa5505..ad9953b28 100644 --- a/chain/vm.go +++ b/chain/vm.go @@ -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 }