Skip to content

Commit 310bb8b

Browse files
committed
Add more comments to version.Encode usage
1 parent 54ed762 commit 310bb8b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/runtime/wasmer/imports.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,9 @@ func ext_misc_runtime_version_version_1(context unsafe.Pointer, dataSpan C.int64
962962

963963
// Note: we must call the `Encode` method and NOT
964964
// scale.Marshal or this one would encode the Version
965-
// interface but not the actual implementation.
965+
// interface pointer instead of the actual struct implementation.
966+
// Encode also respects the legacy boolean field of the version
967+
// and encodes the version differently if it is set to true.
966968
encodedData, err := version.Encode()
967969
if err != nil {
968970
logger.Errorf("failed to encode result: %s", err)

0 commit comments

Comments
 (0)