Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Jul 24, 2024
1 parent ad15268 commit 66bed79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/chains/chain.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package chains

import (
"errors"
"fmt"
"strings"

Expand Down Expand Up @@ -31,6 +32,10 @@ func (chain Chain) Validate() error {
return fmt.Errorf("invalid consensus %d", int32(chain.Consensus))
}

if chain.Name == "" {
return errors.New("chain name cannot be empty")
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/chains/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestChain_Validate(t *testing.T) {
Consensus: chains.Consensus_op_stack,
IsExternal: true,
},
errStr: "invalid chain name",
errStr: "chain name cannot be empty",
},
{
name: "should error if network invalid",
Expand Down

0 comments on commit 66bed79

Please sign in to comment.