Skip to content

Commit

Permalink
cr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
timwu20 committed Jul 18, 2023
1 parent 2880d0e commit e4414f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
9 changes: 4 additions & 5 deletions dot/core/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"context"
"encoding/hex"
"errors"
"io"
"testing"

"github.com/ChainSafe/gossamer/dot/network"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
})
}
Expand Down

0 comments on commit e4414f6

Please sign in to comment.