Skip to content

Commit

Permalink
fix: mock da backend initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs committed Oct 10, 2024
1 parent 358ac6c commit 88b2724
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cmd/rollapp/init/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"path/filepath"
"strings"

"github.com/dymensionxyz/roller/utils/config/tomlconfig"
"github.com/pterm/pterm"
"github.com/spf13/cobra"

initconfig "github.com/dymensionxyz/roller/cmd/config/init"
"github.com/dymensionxyz/roller/cmd/consts"
celestialightclient "github.com/dymensionxyz/roller/data_layer/celestia/lightclient"
"github.com/dymensionxyz/roller/utils/config/tomlconfig"
"github.com/dymensionxyz/roller/utils/errorhandling"
"github.com/dymensionxyz/roller/utils/filesystem"
genesisutils "github.com/dymensionxyz/roller/utils/genesis"
Expand Down Expand Up @@ -202,7 +202,9 @@ func runInit(
return err
}

addresses = append(addresses, *daKeyInfo)
if daKeyInfo != nil {
addresses = append(addresses, *daKeyInfo)
}

/* ------------------------------ Print output ------------------------------ */

Expand Down
10 changes: 7 additions & 3 deletions data_layer/celestia/lightclient/lightclient.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package lightclient

import (
"errors"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -127,7 +126,12 @@ func Initialize(env string, rollerData roller.RollappConfig) (*keys.KeyInfo, err
return nil, err
}

pterm.Info.Printf("the first %s state update has DA height of %s with hash %s\n", rollerData.RollappID, height, hash)
pterm.Info.Printf(
"the first %s state update has DA height of %s with hash %s\n",
rollerData.RollappID,
height,
hash,
)
pterm.Info.Printf("updating %s \n", celestiaConfigFilePath)
err = UpdateConfig(celestiaConfigFilePath, hash, heightInt)
if err != nil {
Expand All @@ -153,7 +157,7 @@ func Initialize(env string, rollerData roller.RollappConfig) (*keys.KeyInfo, err
}
}

return nil, errors.New("failed to initialize da client")
return nil, nil
}

func UpdateConfig(file, hash string, height int) error {
Expand Down

0 comments on commit 88b2724

Please sign in to comment.