Skip to content

Commit 936cdee

Browse files
fix: propogate error from initGenesisChunks to GenesisChunked
1 parent a500675 commit 936cdee

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

node/node.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,9 @@ func (n *Node) GetGenesis() *tmtypes.GenesisDoc {
232232
}
233233

234234
// GetGenesisChunks returns chunked version of genesis.
235-
func (n *Node) GetGenesisChunks() []string {
235+
func (n *Node) GetGenesisChunks() ([]string, error) {
236236
err := n.initGenesisChunks()
237-
if err != nil {
238-
n.Logger.Error("error while creating chunks of the genesis document: %w", err)
239-
}
240-
return n.genChunks
237+
return n.genChunks, err
241238
}
242239

243240
// OnStop is a part of Service interface.

rpc/client/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,10 @@ func (c *Client) Genesis(_ context.Context) (*ctypes.ResultGenesis, error) {
275275

276276
// GenesisChunked returns given chunk of genesis.
277277
func (c *Client) GenesisChunked(context context.Context, id uint) (*ctypes.ResultGenesisChunk, error) {
278-
genChunks := c.node.GetGenesisChunks()
278+
genChunks, err := c.node.GetGenesisChunks()
279+
if err != nil {
280+
return nil, fmt.Errorf("error while creating chunks of the genesis document: %w", err)
281+
}
279282
if genChunks == nil {
280283
return nil, fmt.Errorf("service configuration error, genesis chunks are not initialized")
281284
}

0 commit comments

Comments
 (0)