diff --git a/lib/runtime/wasmer/instance.go b/lib/runtime/wasmer/instance.go index a57f71b175..f1423a938c 100644 --- a/lib/runtime/wasmer/instance.go +++ b/lib/runtime/wasmer/instance.go @@ -159,21 +159,14 @@ func (in *Instance) UpdateRuntimeCode(code []byte) (err error) { // CheckRuntimeVersion finds the runtime version by initiating a temporary // runtime instance using the WASM code provided, and querying it. func CheckRuntimeVersion(code []byte) (version runtime.Version, err error) { - wasmInstance, allocator, err := setupVM(code) - if err != nil { - return nil, fmt.Errorf("setting up VM: %w", err) + config := runtime.InstanceConfig{ + LogLvl: log.DoNotChange, } - - ctx := &runtime.Context{ - Allocator: allocator, - } - wasmInstance.SetContextData(ctx) - - instance := Instance{ - vm: wasmInstance, - ctx: ctx, + instance, err := NewInstance(code, config) + if err != nil { + return version, fmt.Errorf("creating runtime instance: %w", err) } - defer instance.close() + defer instance.Stop() version, err = instance.Version() if err != nil {