Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Jul 18, 2024
1 parent ec0a9f9 commit 0057453
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
9 changes: 4 additions & 5 deletions cmd/zetaclientd/p2p_diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/libp2p/go-libp2p/core/protocol"
drouting "github.com/libp2p/go-libp2p/p2p/discovery/routing"
dutil "github.com/libp2p/go-libp2p/p2p/discovery/util"
"github.com/multiformats/go-multiaddr"
maddr "github.com/multiformats/go-multiaddr"
"github.com/rs/zerolog"

Expand All @@ -28,7 +27,7 @@ import (

func RunDiagnostics(
startLogger zerolog.Logger,
peers []multiaddr.Multiaddr,
peers []maddr.Multiaddr,
hotkeyPk cryptotypes.PrivKey,
cfg config.Config,
) error {
Expand Down Expand Up @@ -60,7 +59,7 @@ func RunDiagnostics(
if len(IP) == 0 {
startLogger.Warn().Msg("empty env MYIP")
}
var externalAddr Multiaddr
var externalAddr maddr.Multiaddr
if len(IP) != 0 {
externalAddr, err = maddr.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", IP, 6668))
if err != nil {
Expand All @@ -72,9 +71,9 @@ func RunDiagnostics(
host, err := libp2p.New(
libp2p.ListenAddrs(listenAddress),
libp2p.Identity(p2pPriKey),
libp2p.AddrsFactory(func(addrs []Multiaddr) []Multiaddr {
libp2p.AddrsFactory(func(addrs []maddr.Multiaddr) []maddr.Multiaddr {
if externalAddr != nil {
return []Multiaddr{externalAddr}
return []maddr.Multiaddr{externalAddr}
}
return addrs
}),
Expand Down
10 changes: 3 additions & 7 deletions cmd/zetaclientd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (

"github.com/cometbft/cometbft/crypto/secp256k1"
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/libp2p/go-libp2p/core"
"github.com/multiformats/go-multiaddr"
maddr "github.com/multiformats/go-multiaddr"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
Expand All @@ -34,8 +32,6 @@ import (
mc "github.com/zeta-chain/zetacore/zetaclient/tss"
)

type Multiaddr = core.Multiaddr

var StartCmd = &cobra.Command{
Use: "start",
Short: "Start ZetaClient Observer",
Expand Down Expand Up @@ -361,14 +357,14 @@ func start(_ *cobra.Command, _ []string) error {
return nil
}

func initPeers(peer string) ([]multiaddr.Multiaddr, error) {
var peers []multiaddr.Multiaddr
func initPeers(peer string) ([]maddr.Multiaddr, error) {
var peers []maddr.Multiaddr

if peer != "" {
address, err := maddr.NewMultiaddr(peer)
if err != nil {
log.Error().Err(err).Msg("NewMultiaddr error")
return []multiaddr.Multiaddr{}, err
return []maddr.Multiaddr{}, err
}
peers = append(peers, address)
}
Expand Down

0 comments on commit 0057453

Please sign in to comment.