From d607ca6118a9d859b99da43e1ba74251faf0d498 Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Tue, 15 Sep 2020 14:56:58 +0100 Subject: [PATCH] refactor: remove IsReceiver branch --- conformance/chaos/actor.go | 4 ---- conformance/chaos/actor_test.go | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/conformance/chaos/actor.go b/conformance/chaos/actor.go index c56abcb8b..bc68b086f 100644 --- a/conformance/chaos/actor.go +++ b/conformance/chaos/actor.go @@ -35,8 +35,6 @@ const ( CallerValidationBranchTwice // CallerValidationBranchIs causes caller validation against CallerValidationArgs.Addrs. CallerValidationBranchIs - // CallerValidationBranchIsReceiver causes validation that the caller was also the receiver. - CallerValidationBranchIsReceiver // CallerValidationBranchType causes caller validation against CallerValidationArgs.Types. CallerValidationBranchType ) @@ -148,8 +146,6 @@ func (a Actor) CallerValidation(rt runtime.Runtime, args *CallerValidationArgs) rt.ValidateImmediateCallerAcceptAny() case CallerValidationBranchIs: rt.ValidateImmediateCallerIs(args.Addrs...) - case CallerValidationBranchIsReceiver: - rt.ValidateImmediateCallerIs(rt.Message().Receiver()) case CallerValidationBranchType: rt.ValidateImmediateCallerType(args.Types...) default: diff --git a/conformance/chaos/actor_test.go b/conformance/chaos/actor_test.go index 675c617ab..a6345da53 100644 --- a/conformance/chaos/actor_test.go +++ b/conformance/chaos/actor_test.go @@ -67,28 +67,6 @@ func TestCallerValidationIs(t *testing.T) { rt.Verify() } -func TestCallerValidationIsReceiver(t *testing.T) { - caller := atesting.NewIDAddr(t, 100) - receiver := atesting.NewIDAddr(t, 101) - builder := mock.NewBuilder(context.Background(), receiver) - - rt := builder.Build(t) - var a Actor - - rt.SetCaller(caller, builtin.AccountActorCodeID) - rt.ExpectValidateCallerAddr(receiver) - // FIXME: https://github.com/filecoin-project/specs-actors/pull/1155 - rt.ExpectAbort(exitcode.ErrForbidden, func() { - rt.Call(a.CallerValidation, &CallerValidationArgs{Branch: CallerValidationBranchIsReceiver}) - }) - rt.Verify() - - rt.SetCaller(receiver, builtin.AccountActorCodeID) - rt.ExpectValidateCallerAddr(receiver) - rt.Call(a.CallerValidation, &CallerValidationArgs{Branch: CallerValidationBranchIsReceiver}) - rt.Verify() -} - func TestCallerValidationType(t *testing.T) { caller := atesting.NewIDAddr(t, 100) receiver := atesting.NewIDAddr(t, 101)