Skip to content

Commit ecfdd74

Browse files
committed
Fix Test_Instance_Version for Kusama
- Add `WithLegacy()` method to set unexported `legacy` field in wasmer test
1 parent bc8487c commit ecfdd74

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/runtime/version.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,10 @@ func DecodeVersion(encoded []byte) (version Version, err error) {
8686
legacy: true,
8787
}, nil
8888
}
89+
90+
// WithLegacy sets the legacy boolean (for Kusama)
91+
// and is only used for tests.
92+
func (v Version) WithLegacy() Version {
93+
v.legacy = true //skipcq: RVV-B0006
94+
return v
95+
}

lib/runtime/wasmer/exports_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func Test_Instance_Version(t *testing.T) {
157157
{Name: [8]uint8{0xbc, 0x9d, 0x89, 0x90, 0x4f, 0x5b, 0x92, 0x3f}, Ver: 0x1},
158158
{Name: [8]uint8{0x37, 0xc8, 0xbb, 0x13, 0x50, 0xa9, 0xa2, 0xa8}, Ver: 0x1},
159159
},
160-
},
160+
}.WithLegacy(),
161161
},
162162
"polkadot v0825": {
163163
instanceBuilder: func(t *testing.T) InstanceVersion {

0 commit comments

Comments
 (0)