Skip to content

Commit

Permalink
call ChainConfig::Validate and ProverConfig::Validate in ChainProverC…
Browse files Browse the repository at this point in the history
…onfig::Init

Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed Oct 12, 2023
1 parent be65dab commit 44846c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package core
import (
"encoding/json"
"errors"
"fmt"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/gogoproto/proto"
Expand Down Expand Up @@ -60,10 +61,14 @@ func (cc *ChainProverConfig) Init(m codec.Codec) error {
var chain ChainConfig
if err := utils.UnmarshalJSONAny(m, &chain, cc.Chain); err != nil {
return err
} else if err := chain.Validate(); err != nil {
return fmt.Errorf("invalid chain config: %v", err)
}
var prover ProverConfig
if err := utils.UnmarshalJSONAny(m, &prover, cc.Prover); err != nil {
return err
} else if err := prover.Validate(); err != nil {
return fmt.Errorf("invalid prover config: %v", err)
}
cc.chain = chain
cc.prover = prover
Expand Down

0 comments on commit 44846c5

Please sign in to comment.