diff --git a/x/wasm/module.go b/x/wasm/module.go index b6048a85e..c100697a0 100644 --- a/x/wasm/module.go +++ b/x/wasm/module.go @@ -215,8 +215,6 @@ func AddModuleInitFlags(startCmd *cobra.Command) { startCmd.Flags().Uint32(flagWasmMemoryCacheSize, defaults.MemoryCacheSize, "Sets the size in MiB (NOT bytes) of an in-memory cache for Wasm modules. Set to 0 to disable.") startCmd.Flags().Uint64(flagWasmQueryGasLimit, defaults.SmartQueryGasLimit, "Set the max gas that can be spent on executing a query with a Wasm contract") startCmd.Flags().String(flagWasmSimulationGasLimit, "", "Set the max gas that can be spent when executing a simulation TX") - - startCmd.PreRunE = chainPreRuns(checkLibwasmVersion, startCmd.PreRunE) } // ReadWasmConfig reads the wasm specifig configuration diff --git a/x/wasm/module_test.go b/x/wasm/module_test.go index 9d5087c50..8d48c058d 100644 --- a/x/wasm/module_test.go +++ b/x/wasm/module_test.go @@ -4,11 +4,7 @@ import ( "bytes" "encoding/json" "fmt" - "io" "os" - "os/exec" - "path/filepath" - "strings" "testing" "github.com/dvsekhvalnov/jose2go/base64url" @@ -24,7 +20,6 @@ import ( stakingkeeper "github.com/Finschia/finschia-sdk/x/staking/keeper" "github.com/Finschia/ostracon/crypto" "github.com/Finschia/ostracon/crypto/ed25519" - wasmvm "github.com/Finschia/wasmvm" "github.com/Finschia/wasmd/x/wasm/keeper" "github.com/Finschia/wasmd/x/wasm/keeper/testdata" @@ -586,38 +581,3 @@ func assertContractInfo(t *testing.T, q sdk.Querier, ctx sdk.Context, contractBe assert.Equal(t, codeID, res.CodeID) assert.Equal(t, creator.String(), res.Creator) } - -func TestCheckLibwasmVersion(t *testing.T) { - f, err := os.Open(filepath.Join(moduleBasePath(t), "go.mod")) - assert.NoError(t, err) - - res, err := io.ReadAll(f) - assert.NoError(t, err) - parsed := strings.Split(string(res), "\n") - var expected string - for _, line := range parsed { - if strings.Contains(line, "github.com/Finschia/wasmvm") { - expected = strings.Split(strings.TrimSpace(line), " ")[1] - } - } - got, err := wasmvm.LibwasmvmVersion() - assert.NoError(t, err) - assert.Contains(t, expected, got) -} - -func moduleBasePath(t *testing.T) string { - t.Helper() - - err := os.Setenv("GO111MODULE", "on") - if err != nil { - t.Fatalf("unable to set GO111MODULE env var: %v", err) - } - - cmd := exec.Command("go", "list", "-f", "{{.Module.Dir}}") - out, err := cmd.Output() - if err != nil { - t.Fatalf("failed to evaluate Go module base path: %v", err) - } - - return strings.TrimSpace(string(out)) -}