Skip to content

Commit

Permalink
Add more comments to version.Encode usage
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jul 20, 2022
1 parent 871bac3 commit 0d34d13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/runtime/wasmer/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,9 @@ func ext_misc_runtime_version_version_1(context unsafe.Pointer, dataSpan C.int64

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

0 comments on commit 0d34d13

Please sign in to comment.