From 2880d0e9d38807ff6d00c9b5ae2c08dd93574a5c Mon Sep 17 00:00:00 2001 From: Timothy Wu Date: Tue, 27 Jun 2023 12:16:42 -0400 Subject: [PATCH] fix lint --- lib/runtime/wasmer/exports_test.go | 4 ++-- lib/runtime/wazero/test_helpers.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/runtime/wasmer/exports_test.go b/lib/runtime/wasmer/exports_test.go index 2af04987eb4..7a9f937a6ea 100644 --- a/lib/runtime/wasmer/exports_test.go +++ b/lib/runtime/wasmer/exports_test.go @@ -1223,7 +1223,7 @@ func TestInstance_ExecuteBlock_WestendBlock1097836(t *testing.T) { *types.NewBABEPreRuntimeDigest(common.MustHexToBytes("0x02020000006522d30f00000000")), types.SealDigest{ ConsensusEngineID: types.BabeEngineID, - Data: common.MustHexToBytes("0xa06e4a23ae347c7edd24f84153c007563895d64a06b8781b1e21bf2c8bc426676bfd4bf20c08f276e54598aff3b64541d84c4b5da7bfa39479d0a45585a75388"), + Data: common.MustHexToBytes("0xa06e4a23ae347c7edd24f84153c007563895d64a06b8781b1e21bf2c8bc426676bfd4bf20c08f276e54598aff3b64541d84c4b5da7bfa39479d0a45585a75388"), //nolint:lll }, ) @@ -1234,7 +1234,7 @@ func TestInstance_ExecuteBlock_WestendBlock1097836(t *testing.T) { ext, err = common.HexToBytes("0x040d0000") require.NoError(t, err) exts = append(exts, ext) - ext, err = common.HexToBytes("0x84c2c9676ac7a4e56bcb861cf443899114a17baa817ae5c295b9bb6f947fc427fd02db25d6a66498b5e81ac3a52ae4025eef7bb36eee31195c60c7ebdb6f0bac4177baf32e73719fe3e5fdce1059e9e16bb85bad0a0c4e34c4b0e680fb7a132cc4f7018502000004000c60f6d9b5a5ee5a0c0428d1940936a1b91cd29924578f7ac9e793db6dab0cd70700e40b5402") + ext, err = common.HexToBytes("0x84c2c9676ac7a4e56bcb861cf443899114a17baa817ae5c295b9bb6f947fc427fd02db25d6a66498b5e81ac3a52ae4025eef7bb36eee31195c60c7ebdb6f0bac4177baf32e73719fe3e5fdce1059e9e16bb85bad0a0c4e34c4b0e680fb7a132cc4f7018502000004000c60f6d9b5a5ee5a0c0428d1940936a1b91cd29924578f7ac9e793db6dab0cd70700e40b5402") //nolint:lll require.NoError(t, err) exts = append(exts, ext) diff --git a/lib/runtime/wazero/test_helpers.go b/lib/runtime/wazero/test_helpers.go index 78e1f4cfdee..fe752d32381 100644 --- a/lib/runtime/wazero/test_helpers.go +++ b/lib/runtime/wazero/test_helpers.go @@ -7,6 +7,7 @@ import ( "context" "fmt" "os" + "path/filepath" "testing" "github.com/ChainSafe/gossamer/internal/log" @@ -73,9 +74,9 @@ func NewTestInstanceWithTrie(t *testing.T, targetRuntime string, tt *trie.Trie) func NewInstanceFromFile(fp string, cfg Config) (*Instance, error) { // Reads the WebAssembly module as bytes. // Retrieve WASM binary - bytes, err := os.ReadFile(fp) + bytes, err := os.ReadFile(filepath.Clean(fp)) if err != nil { - return nil, fmt.Errorf("Failed to read wasm file: %s", err) + return nil, fmt.Errorf("failed to read wasm file: %s", err) } return NewInstance(bytes, cfg)