From ecfdd74c29c525cdf3b12719371239f488b931bd Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Wed, 20 Jul 2022 14:35:28 +0000 Subject: [PATCH] Fix `Test_Instance_Version` for Kusama - Add `WithLegacy()` method to set unexported `legacy` field in wasmer test --- lib/runtime/version.go | 7 +++++++ lib/runtime/wasmer/exports_test.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/runtime/version.go b/lib/runtime/version.go index 90b3bce99e..9b0f3aadd3 100644 --- a/lib/runtime/version.go +++ b/lib/runtime/version.go @@ -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 +} diff --git a/lib/runtime/wasmer/exports_test.go b/lib/runtime/wasmer/exports_test.go index 17d636267e..2f6b3b00a9 100644 --- a/lib/runtime/wasmer/exports_test.go +++ b/lib/runtime/wasmer/exports_test.go @@ -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 {