Skip to content

Commit

Permalink
[1757]: Unit tests on the two new commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyLemon committed Nov 23, 2023
1 parent b1d7325 commit 04fc557
Show file tree
Hide file tree
Showing 2 changed files with 414 additions and 44 deletions.
6 changes: 4 additions & 2 deletions cmd/provenanced/cmd/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,10 @@ func AddGenesisCustomMarketCmd(defaultNodeHome string) *cobra.Command {
func addMarketsToAppState(clientCtx client.Context, appState map[string]json.RawMessage, markets ...exchange.Market) error {
cdc := clientCtx.Codec
var exGenState exchange.GenesisState
if err := cdc.UnmarshalJSON(appState[exchange.ModuleName], &exGenState); err != nil {
return fmt.Errorf("could not extract exchange genesis state: %w", err)
if len(appState[exchange.ModuleName]) > 0 {
if err := cdc.UnmarshalJSON(appState[exchange.ModuleName], &exGenState); err != nil {
return fmt.Errorf("could not extract exchange genesis state: %w", err)
}
}

for _, market := range markets {
Expand Down
Loading

0 comments on commit 04fc557

Please sign in to comment.