Skip to content

Commit

Permalink
go/oasis-node/cmd/node: Make initGenesis()' errors more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
tjanez committed Jun 3, 2020
1 parent f2c8d45 commit 97b9716
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/oasis-node/cmd/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,21 +423,21 @@ func (n *Node) initGenesis(testNode bool) error {
// Well, there wasn't a genesis document and we're running unit tests,
// so use a test node one.
if n.Genesis, err = tendermintTestsGenesis.NewTestNodeGenesisProvider(n.Identity); err != nil {
return err
return fmt.Errorf("initGenesis: failed to create test node genesis: %w", err)
}

// In case of a test node, always use the test chain context.
genesisTestHelpers.SetTestChainContext()
return nil
}
return err
return fmt.Errorf("initGenesis: failed to create local genesis file provider: %w", err)
}

// Retrieve the genesis document and use it to configure the ChainID for
// signature domain separation. We do this as early as possible.
genesisDoc, err := n.Genesis.GetGenesisDocument()
if err != nil {
return err
return fmt.Errorf("initGenesis: failed to get genesis: %w", err)
}
genesisDoc.SetChainContext()

Expand Down

0 comments on commit 97b9716

Please sign in to comment.