Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Feb 21, 2025
1 parent d55abd0 commit cffca25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions packages/taiko-client/driver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/taikoxyz/taiko-mono/packages/taiko-client/cmd/flags"
"github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/jwt"
"github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/rpc"
"github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/utils"
)

// Config contains the configurations to initialize a Taiko driver.
Expand Down Expand Up @@ -126,6 +127,11 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
return nil, err
}

// Check if the P2P signer setup is empty.
if c.Uint64(flags.PreconfBlockServerPort.Name) > 0 && utils.IsNil(signerConfigs) {
return nil, errors.New("empty P2P signer setup")
}

return &Config{
ClientConfig: clientConfig,
RetryInterval: c.Duration(flags.BackOffRetryInterval.Name),
Expand Down
9 changes: 4 additions & 5 deletions packages/taiko-client/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,10 @@ func (d *Driver) InitFromConfig(ctx context.Context, cfg *Config) (err error) {

log.Info("P2PNode", "Addrs", d.p2pNode.Host().Addrs(), "PeerID", d.p2pNode.Host().ID())

if reflect2.IsNil(d.Config.P2PSignerConfigs) {
return errors.New("missing P2P signer setup")
}
if d.p2pSigner, err = d.P2PSignerConfigs.SetupSigner(d.ctx); err != nil {
return err
if !reflect2.IsNil(d.Config.P2PSignerConfigs) {
if d.p2pSigner, err = d.P2PSignerConfigs.SetupSigner(d.ctx); err != nil {
return err
}
}

d.preconfBlockServer.SetP2PNode(d.p2pNode)
Expand Down

0 comments on commit cffca25

Please sign in to comment.