diff --git a/pkg/chain/utils.go b/pkg/chain/utils.go index 924fddee5a..533f6318f7 100644 --- a/pkg/chain/utils.go +++ b/pkg/chain/utils.go @@ -26,7 +26,6 @@ import ( exported5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/exported" exported6 "github.com/filecoin-project/specs-actors/v6/actors/builtin/exported" exported7 "github.com/filecoin-project/specs-actors/v7/actors/builtin/exported" - /* inline-gen end */ "github.com/filecoin-project/venus/venus-shared/actors/builtin" diff --git a/pkg/vm/vmcontext/runtime_adapter.go b/pkg/vm/vmcontext/runtime_adapter.go index 2f01cb2c88..fb28259254 100644 --- a/pkg/vm/vmcontext/runtime_adapter.go +++ b/pkg/vm/vmcontext/runtime_adapter.go @@ -16,6 +16,12 @@ import ( "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-state-types/network" "github.com/filecoin-project/go-state-types/rt" + + /* inline-gen template + {{range .actorVersions}} + rt{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/runtime"{{end}} + /* inline-gen start */ + rt0 "github.com/filecoin-project/specs-actors/actors/runtime" rt2 "github.com/filecoin-project/specs-actors/v2/actors/runtime" rt3 "github.com/filecoin-project/specs-actors/v3/actors/runtime" @@ -23,6 +29,7 @@ import ( rt5 "github.com/filecoin-project/specs-actors/v5/actors/runtime" rt6 "github.com/filecoin-project/specs-actors/v6/actors/runtime" rt7 "github.com/filecoin-project/specs-actors/v7/actors/runtime" + /* inline-gen end */ "github.com/filecoin-project/venus/pkg/vm/gas" "github.com/filecoin-project/venus/pkg/vm/runtime" @@ -45,6 +52,11 @@ func init() { var actorLog = logging.Logger("vm.actors") +/* inline-gen template +{{range .actorVersions}} +var _ rt{{.}}.Runtime = (*runtimeAdapter)(nil){{end}} +/* inline-gen start */ + var _ rt0.Runtime = (*runtimeAdapter)(nil) var _ rt2.Runtime = (*runtimeAdapter)(nil) var _ rt3.Runtime = (*runtimeAdapter)(nil) @@ -53,6 +65,8 @@ var _ rt5.Runtime = (*runtimeAdapter)(nil) var _ rt6.Runtime = (*runtimeAdapter)(nil) var _ rt7.Runtime = (*runtimeAdapter)(nil) +/* inline-gen end */ + type runtimeAdapter struct { ctx *invocationContext syscalls diff --git a/pkg/vm/vmcontext/syscalls.go b/pkg/vm/vmcontext/syscalls.go index e3ca994c94..400c951ded 100644 --- a/pkg/vm/vmcontext/syscalls.go +++ b/pkg/vm/vmcontext/syscalls.go @@ -10,10 +10,23 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/network" - rt7 "github.com/filecoin-project/specs-actors/v7/actors/runtime" proof7 "github.com/filecoin-project/specs-actors/v7/actors/runtime/proof" "github.com/ipfs/go-cid" + /* inline-gen template + {{range .actorVersions}} + rt{{.}} "github.com/filecoin-project/specs-actors{{import .}}actors/runtime"{{end}} + /* inline-gen start */ + + rt0 "github.com/filecoin-project/specs-actors/actors/runtime" + rt2 "github.com/filecoin-project/specs-actors/v2/actors/runtime" + rt3 "github.com/filecoin-project/specs-actors/v3/actors/runtime" + rt4 "github.com/filecoin-project/specs-actors/v4/actors/runtime" + rt5 "github.com/filecoin-project/specs-actors/v5/actors/runtime" + rt6 "github.com/filecoin-project/specs-actors/v6/actors/runtime" + rt7 "github.com/filecoin-project/specs-actors/v7/actors/runtime" + /* inline-gen end */ + "github.com/filecoin-project/venus/pkg/crypto" vmState "github.com/filecoin-project/venus/pkg/state/tree" "github.com/filecoin-project/venus/pkg/vm/gas" @@ -51,8 +64,21 @@ type syscalls struct { stateView SyscallsStateView } +/* inline-gen template +{{range .actorVersions}} +var _ rt{{.}}.Syscalls = (*syscalls)(nil){{end}} +/* inline-gen start */ + +var _ rt0.Syscalls = (*syscalls)(nil) +var _ rt2.Syscalls = (*syscalls)(nil) +var _ rt3.Syscalls = (*syscalls)(nil) +var _ rt4.Syscalls = (*syscalls)(nil) +var _ rt5.Syscalls = (*syscalls)(nil) +var _ rt6.Syscalls = (*syscalls)(nil) var _ rt7.Syscalls = (*syscalls)(nil) +/* inline-gen end */ + func (sys syscalls) VerifySignature(signature crypto.Signature, signer address.Address, plaintext []byte) error { charge, err := sys.pricelist.OnVerifySignature(signature.Type, len(plaintext)) if err != nil {