Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions gen/suites/msg_application/invalid_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/exitcode"
"github.com/filecoin-project/specs-actors/actors/builtin"

. "github.com/filecoin-project/test-vectors/gen/builders"
)
Expand Down Expand Up @@ -36,3 +37,15 @@ func failInvalidReceiverMethod(v *MessageVectorBuilder) {

v.Assert.EveryMessageResultSatisfies(ExitCode(exitcode.SysErrInvalidMethod))
}

func failInvalidSenderNonAccountActor(v *MessageVectorBuilder) {
v.Messages.SetDefaults(GasLimit(1_000_000_000), GasPremium(1), GasFeeCap(200))

alice := v.Actors.Account(address.SECP256K1, balance1T)
v.CommitPreconditions()

v.Messages.Sugar().Transfer(builtin.SystemActorAddr, alice.ID, Nonce(0), Value(transferAmnt))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while sending from system is disallowed, might also be worth validating that sending from a storageMiner type address is disallowed, since that's one where a party could plausibly have a key to properly sign the thing?

v.CommitApplies()

v.Assert.EveryMessageResultSatisfies(ExitCode(exitcode.SysErrSenderInvalid))
}
8 changes: 8 additions & 0 deletions gen/suites/msg_application/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ func main() {
},
MessageFunc: failInvalidReceiverMethod,
},
&VectorDef{
Metadata: &Metadata{
ID: "msg-apply-fail-invalid-sender-non-account-actor",
Version: "v1",
Desc: "sends from non-account actors are disallowed",
},
MessageFunc: failInvalidSenderNonAccountActor,
},
)

g.Group("unknown_actors",
Expand Down