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) } }) }