Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
jairad26 committed Oct 22, 2024
1 parent c128522 commit b4723a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/metadata/extras.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import (
"github.com/hypermodeinc/modus/lib/wasmextractor"
)

func GetMetadataFromCompiledModule(cm []byte) (*Metadata, error) {
customSections, err := getCustomSections(cm)
func GetMetadataFromWasm(wasm []byte) (*Metadata, error) {
customSections, err := getCustomSections(wasm)
if err != nil {
return nil, err
}
return GetMetadata(customSections)
}

func getCustomSections(cm []byte) (map[string][]byte, error) {
info, err := wasmextractor.ExtractWasmInfo(cm)
func getCustomSections(wasm []byte) (map[string][]byte, error) {
info, err := wasmextractor.ExtractWasmInfo(wasm)
if err != nil {
return nil, err
}
Expand Down
Binary file modified runtime/integration_tests/testdata/postgresql-example.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion runtime/pluginmanager/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func loadPlugin(ctx context.Context, filename string) error {
}

// Get the metadata for the plugin.
md, err := metadata.GetMetadataFromCompiledModule(bytes)
md, err := metadata.GetMetadataFromWasm(bytes)
if err == metadata.ErrMetadataNotFound {
logger.Error(ctx).
Bool("user_visible", true).
Expand Down
2 changes: 1 addition & 1 deletion runtime/testutils/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewWasmTestFixture(wasmFilePath string, customTypes map[string]reflect.Type
panic(err)
}

md, err := metadata.GetMetadataFromCompiledModule(content)
md, err := metadata.GetMetadataFromWasm(content)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit b4723a1

Please sign in to comment.