github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/test/patch_modules/vm.go (about)

     1  package patch_modules
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/agiledragon/gomonkey/v2"
     7  
     8  	"github.com/machinefi/w3bstream/pkg/depends/base/types"
     9  	"github.com/machinefi/w3bstream/pkg/enums"
    10  	"github.com/machinefi/w3bstream/pkg/modules/vm"
    11  )
    12  
    13  func VmNewInstance(patch *gomonkey.Patches, err error) *gomonkey.Patches {
    14  	return patch.ApplyFunc(
    15  		vm.NewInstance,
    16  		func(_ context.Context, _ []byte, _ types.SFID, _ enums.InstanceState) error { return err },
    17  	)
    18  }