Skip to content

Commit

Permalink
Merge pull request #4232 from filecoin-project/steb/fix-v2-actor-error
Browse files Browse the repository at this point in the history
return an illegal actor error when we see an unsupported actor version
  • Loading branch information
magik6k authored Oct 7, 2020
2 parents 14bb4c9 + b0bea5f commit 79dba81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chain/vm/invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ func (ar *ActorRegistry) Invoke(codeCid cid.Cid, rt vmr.Runtime, method abi.Meth
log.Errorf("no code for actor %s (Addr: %s)", codeCid, rt.Receiver())
return nil, aerrors.Newf(exitcode.SysErrorIllegalActor, "no code for actor %s(%d)(%s)", codeCid, method, hex.EncodeToString(params))
}
if err := act.predicate(rt, act.vmActor); err != nil {
return nil, aerrors.Newf(exitcode.SysErrorIllegalActor, "unsupported actor: %s", err)
}
if method >= abi.MethodNum(len(act.methods)) || act.methods[method] == nil {
return nil, aerrors.Newf(exitcode.SysErrInvalidMethod, "no method %d on actor", method)
}
if err := act.predicate(rt, act.vmActor); err != nil {
return nil, aerrors.Newf(exitcode.SysErrInvalidMethod, "unsupported actor: %s", err)
}
return act.methods[method](rt, params)

}
Expand Down

0 comments on commit 79dba81

Please sign in to comment.