Skip to content

Commit

Permalink
perf(light-clients):use errors.New to replace fmt.Errorf with no para…
Browse files Browse the repository at this point in the history
…meters
  • Loading branch information
seay404 committed May 2, 2024
1 parent 06eb5c7 commit 2faa880
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ var tempDir = func() string {
// Ref: https://github.com/cosmos/ibc-go/issues/4821#issuecomment-1747240445
func CheckLibwasmVersion(wasmExpectedVersion string) error {
if wasmExpectedVersion == "" {
return fmt.Errorf("wasmvm module not exist")
return errors.New("wasmvm module not exist")
}
wasmVersion, err := wasmvm.LibwasmvmVersion()
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions modules/light-clients/08-wasm/types/consensus_host.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package types

import (
"fmt"
"errors"

errorsmod "cosmossdk.io/errors"

Expand All @@ -23,11 +23,11 @@ var _ clienttypes.ConsensusHost = (*WasmConsensusHost)(nil)
// NewWasmConsensusHost creates and returns a new ConsensusHost for wasm wrapped consensus client state and consensus state self validation.
func NewWasmConsensusHost(cdc codec.BinaryCodec, delegate clienttypes.ConsensusHost) (*WasmConsensusHost, error) {
if cdc == nil {
return nil, fmt.Errorf("wasm consensus host codec is nil")
return nil, errors.New("wasm consensus host codec is nil")
}

if delegate == nil {
return nil, fmt.Errorf("wasm delegate consensus host is nil")
return nil, errors.New("wasm delegate consensus host is nil")
}

return &WasmConsensusHost{
Expand Down

0 comments on commit 2faa880

Please sign in to comment.