From e1d5691153b48bc45a9560219b3b3c63e26e22dc Mon Sep 17 00:00:00 2001 From: Timothy Wu Date: Mon, 17 Jul 2023 23:51:04 -0400 Subject: [PATCH] cr feedback --- config/config.go | 2 +- dot/core/service_test.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index bc06f646e3a..d2602a42657 100644 --- a/config/config.go +++ b/config/config.go @@ -279,7 +279,7 @@ func (c *CoreConfig) ValidateBasic() error { if c.WasmInterpreter == "" { return fmt.Errorf("wasm-interpreter cannot be empty") } - if !(c.WasmInterpreter == wasmer.Name || c.WasmInterpreter == wazero.Name) { + if c.WasmInterpreter != wasmer.Name && c.WasmInterpreter != wazero.Name { return fmt.Errorf("wasm-interpreter is invalid") } diff --git a/dot/core/service_test.go b/dot/core/service_test.go index c8296fb7c31..1fe835f5935 100644 --- a/dot/core/service_test.go +++ b/dot/core/service_test.go @@ -8,6 +8,7 @@ import ( "context" "encoding/hex" "errors" + "io" "testing" "github.com/ChainSafe/gossamer/dot/network" @@ -251,7 +252,7 @@ func Test_Service_handleCodeSubstitution(t *testing.T) { } }, blockHash: common.Hash{0x01}, - errMessage: "creating new runtime instance: unexpected EOF", + errWrapped: io.ErrUnexpectedEOF, }, "store_code_substitution_block_hash_error": { serviceBuilder: func(ctrl *gomock.Controller) *Service { @@ -323,11 +324,9 @@ func Test_Service_handleCodeSubstitution(t *testing.T) { service := testCase.serviceBuilder(ctrl) err := service.handleCodeSubstitution(testCase.blockHash, testCase.trieState) - if testCase.errWrapped != nil { - assert.ErrorIs(t, err, testCase.errWrapped) - } + assert.ErrorIs(t, err, testCase.errWrapped) if testCase.errMessage != "" { - assert.ErrorContains(t, err, testCase.errMessage) + assert.EqualError(t, err, testCase.errMessage) } }) }