Skip to content

Commit

Permalink
Fix Test_Instance_Version for Kusama
Browse files Browse the repository at this point in the history
- Add `WithLegacy()` method to set unexported `legacy` field in wasmer test
  • Loading branch information
qdm12 committed Jul 28, 2022
1 parent bc8487c commit ecfdd74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/runtime/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,10 @@ func DecodeVersion(encoded []byte) (version Version, err error) {
legacy: true,
}, nil
}

// WithLegacy sets the legacy boolean (for Kusama)
// and is only used for tests.
func (v Version) WithLegacy() Version {
v.legacy = true //skipcq: RVV-B0006
return v
}
2 changes: 1 addition & 1 deletion lib/runtime/wasmer/exports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func Test_Instance_Version(t *testing.T) {
{Name: [8]uint8{0xbc, 0x9d, 0x89, 0x90, 0x4f, 0x5b, 0x92, 0x3f}, Ver: 0x1},
{Name: [8]uint8{0x37, 0xc8, 0xbb, 0x13, 0x50, 0xa9, 0xa2, 0xa8}, Ver: 0x1},
},
},
}.WithLegacy(),
},
"polkadot v0825": {
instanceBuilder: func(t *testing.T) InstanceVersion {
Expand Down

0 comments on commit ecfdd74

Please sign in to comment.