-
Notifications
You must be signed in to change notification settings - Fork 459
/
vm.go
49 lines (34 loc) · 1.46 KB
/
vm.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package vm
import (
"context"
"github.com/filecoin-project/venus/pkg/vm/dispatch"
"github.com/filecoin-project/venus/pkg/vm/register"
"github.com/filecoin-project/venus/pkg/vm/vmcontext"
)
// Re-exports
type VmOption = vmcontext.VmOption //nolint
type Ret = vmcontext.Ret
// Interpreter is the VM.
type Interpreter = vmcontext.VMInterpreter
type SyscallsImpl = vmcontext.SyscallsImpl
type SyscallsStateView = vmcontext.SyscallsStateView
type ExecCallBack = vmcontext.ExecCallBack
type VmMessage = vmcontext.VmMessage //nolint
type FakeSyscalls = vmcontext.FakeSyscalls
type ChainRandomness = vmcontext.HeadChainRandomness
// NewVM creates a new VM interpreter.
func NewVM(ctx context.Context, option VmOption) (Interpreter, error) {
if option.ActorCodeLoader == nil {
option.ActorCodeLoader = &DefaultActors
}
return vmcontext.NewVM(ctx, option.ActorCodeLoader, option)
}
// DefaultActors is a code loader with the built-in actors that come with the system.
var DefaultActors = register.DefaultActors
// ActorCodeLoader allows yo to load an actor's code based on its id an epoch.
type ActorCodeLoader = dispatch.CodeLoader
// ActorMethodSignature wraps a specific method and allows you to encode/decodes input/output bytes into concrete types.
type ActorMethodSignature = dispatch.MethodSignature
type ILookBack = vmcontext.ILookBack
type LookbackStateGetter = vmcontext.LookbackStateGetter
//type LookbackStateGetterForTipset = vmcontext.LookbackStateGetterForTipset