Skip to content

Commit

Permalink
call Initialize before LoadOrCreateEdSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiangxu committed Jul 18, 2023
1 parent 6e85b00 commit 4c36f41
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func GetCommand() *cobra.Command {
}
defer app.Unlock()

if err := app.Initialize(); err != nil {
return err
}

Check warning on line 150 in node/node.go

View check run for this annotation

Codecov / codecov/patch

node/node.go#L148-L150

Added lines #L148 - L150 were not covered by tests

/* Create or load miner identity */
if app.edSgn, err = app.LoadOrCreateEdSigner(); err != nil {
return fmt.Errorf("could not retrieve identity: %w", err)
Expand All @@ -155,10 +159,6 @@ func GetCommand() *cobra.Command {
return err
}

if err := app.Initialize(); err != nil {
return err
}

// This blocks until the context is finished or until an error is produced
err = app.Start(ctx)

Expand Down Expand Up @@ -1194,10 +1194,6 @@ func (app *App) LoadOrCreateEdSigner() (*signing.EdSigner, error) {
filename := filepath.Join(app.Config.SMESHING.Opts.DataDir, edKeyFileName)
log.Info("Looking for identity file at `%v`", filename)

if err := app.Config.Genesis.Validate(); err != nil {
return nil, fmt.Errorf("invalid genesis: %w", err)
}

var data []byte
if len(app.Config.TestConfig.SmesherKey) > 0 {
log.With().Error("!!!TESTING!!! using pre-configured smesher key")
Expand Down

0 comments on commit 4c36f41

Please sign in to comment.