Skip to content

Commit

Permalink
add check wasmExpectedVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
GNaD13 committed Oct 3, 2022
1 parent dcdef65 commit 691d881
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion x/wasm/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ func getExpectedLibwasmVersion() string {
}
if d.Replace != nil {
return fmt.Sprintf(d.Replace.Version)

}
return fmt.Sprintf(d.Version)
}
Expand All @@ -281,6 +280,9 @@ func checkLibwasmVersion(cmd *cobra.Command, args []string) error {
return fmt.Errorf("unable to retrieve libwasmversion %w", err)
}
wasmExpectedVersion := getExpectedLibwasmVersion()
if wasmExpectedVersion == "" {
return fmt.Errorf("wasmvm module not exist")
}
if !strings.Contains(wasmExpectedVersion, wasmVersion) {
return fmt.Errorf("libwasmversion mismatch. got: %s; expected: %s", wasmVersion, wasmExpectedVersion)
}
Expand Down

0 comments on commit 691d881

Please sign in to comment.