chore: refactor: rename NewVM to NewLotusVM
This commit is contained in:
parent
420c5fb568
commit
9bb936b75c
@ -494,9 +494,9 @@ func VerifyPreSealedData(ctx context.Context, cs *store.ChainStore, sys vm.Sysca
|
||||
NetworkVersion: nv,
|
||||
BaseFee: types.NewInt(0),
|
||||
}
|
||||
vm, err := vm.NewVM(ctx, &vmopt)
|
||||
vm, err := vm.NewLotusVM(ctx, &vmopt)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to create NewVM: %w", err)
|
||||
return cid.Undef, xerrors.Errorf("failed to create NewLotusVM: %w", err)
|
||||
}
|
||||
|
||||
for mi, m := range template.Miners {
|
||||
|
@ -98,9 +98,9 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal
|
||||
BaseFee: types.NewInt(0),
|
||||
}
|
||||
|
||||
vm, err := vm.NewVM(ctx, vmopt)
|
||||
vm, err := vm.NewLotusVM(ctx, vmopt)
|
||||
if err != nil {
|
||||
return cid.Undef, xerrors.Errorf("failed to create NewVM: %w", err)
|
||||
return cid.Undef, xerrors.Errorf("failed to create NewLotusVM: %w", err)
|
||||
}
|
||||
|
||||
if len(miners) == 0 {
|
||||
|
@ -167,7 +167,7 @@ func TestForkHeightTriggers(t *testing.T) {
|
||||
inv.Register(nil, testActor{})
|
||||
|
||||
sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (*vm.VM, error) {
|
||||
nvm, err := vm.NewVM(ctx, vmopt)
|
||||
nvm, err := vm.NewLotusVM(ctx, vmopt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -282,7 +282,7 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) {
|
||||
inv.Register(nil, testActor{})
|
||||
|
||||
sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (*vm.VM, error) {
|
||||
nvm, err := vm.NewVM(ctx, vmopt)
|
||||
nvm, err := vm.NewLotusVM(ctx, vmopt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -501,7 +501,7 @@ func TestForkPreMigration(t *testing.T) {
|
||||
inv.Register(nil, testActor{})
|
||||
|
||||
sm.SetVMConstructor(func(ctx context.Context, vmopt *vm.VMOpts) (*vm.VM, error) {
|
||||
nvm, err := vm.NewVM(ctx, vmopt)
|
||||
nvm, err := vm.NewLotusVM(ctx, vmopt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ func NewStateManager(cs *store.ChainStore, exec Executor, sys vm.SyscallBuilder,
|
||||
latestVersion: lastVersion,
|
||||
stateMigrations: stateMigrations,
|
||||
expensiveUpgrades: expensiveUpgrades,
|
||||
newVM: vm.NewVM,
|
||||
newVM: vm.NewLotusVM,
|
||||
Syscalls: sys,
|
||||
cs: cs,
|
||||
tsExec: exec,
|
||||
|
@ -234,7 +234,7 @@ type VMOpts struct {
|
||||
LookbackState LookbackStateGetter
|
||||
}
|
||||
|
||||
func NewVM(ctx context.Context, opts *VMOpts) (*VM, error) {
|
||||
func NewLotusVM(ctx context.Context, opts *VMOpts) (*VM, error) {
|
||||
buf := blockstore.NewBuffered(opts.Bstore)
|
||||
cst := cbor.NewCborStore(buf)
|
||||
state, err := state.LoadStateTree(cst, opts.StateBase)
|
||||
|
@ -92,7 +92,7 @@ func NewBlockBuilder(ctx context.Context, logger *zap.SugaredLogger, sm *stmgr.S
|
||||
BaseFee: abi.NewTokenAmount(0),
|
||||
LookbackState: stmgr.LookbackStateGetterForTipset(sm, parentTs),
|
||||
}
|
||||
bb.vm, err = vm.NewVM(bb.ctx, vmopt)
|
||||
bb.vm, err = vm.NewLotusVM(bb.ctx, vmopt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, params
|
||||
return big.Zero(), nil
|
||||
}
|
||||
|
||||
return vm.NewVM(ctx, vmopt)
|
||||
return vm.NewLotusVM(ctx, vmopt)
|
||||
})
|
||||
|
||||
postcid, receiptsroot, err := tse.ApplyBlocks(context.Background(),
|
||||
@ -226,7 +226,7 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageP
|
||||
NetworkVersion: params.NetworkVersion,
|
||||
}
|
||||
|
||||
lvm, err := vm.NewVM(context.TODO(), vmOpts)
|
||||
lvm, err := vm.NewLotusVM(context.TODO(), vmOpts)
|
||||
if err != nil {
|
||||
return nil, cid.Undef, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user