Skip to content

Commit

Permalink
chore: Allow mock da on a non-local hub (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayLevyOfficial authored Aug 27, 2023
1 parent e57669c commit 09a18aa
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/config/init/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func addFlags(cmd *cobra.Command) error {
"The precision level of the RollApp's token defined by the number of decimal places. "+
"It should be an integer ranging between 1 and 18. This is akin to how 1 Ether equates to 10^18 Wei in Ethereum. "+
"Note: EVM RollApps must set this value to 18.")
cmd.Flags().StringP(FlagNames.DAType, "", "Celestia", "The DA layer for the RollApp. Can be one of 'Celestia, Avail, Mock'")
cmd.Flags().StringP(FlagNames.DAType, "", "Celestia", "The DA layer for the RollApp. Can be one of 'Celestia, Avail, Local'")

// TODO: Expose when supporting custom sdk rollapps.
err := cmd.Flags().MarkHidden(FlagNames.Decimals)
Expand Down
5 changes: 1 addition & 4 deletions cmd/config/init/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ func RunInteractiveMode(cfg *config.RollappConfig) error {
}
cfg.TokenSupply = supply

availableDAs := []config.DAType{config.Celestia, config.Avail}
if mode == "local" {
availableDAs = append(availableDAs, config.Mock)
}
availableDAs := []config.DAType{config.Celestia, config.Avail, config.Local}
promptDAType := promptui.Select{
Label: "Choose your data layer",
Items: availableDAs,
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const (
type DAType string

const (
Mock DAType = "mock"
Local DAType = "local"
Celestia DAType = "celestia"
Avail DAType = "avail"
)
Expand Down Expand Up @@ -80,7 +80,7 @@ func (c RollappConfig) Validate() error {

func IsValidDAType(t string) bool {
switch DAType(t) {
case Mock, Celestia, Avail:
case Local, Celestia, Avail:
return true
}
return false
Expand Down
2 changes: 1 addition & 1 deletion data_layer/da_layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func NewDAManager(datype config.DAType, home string) *DAManager {
dalayer = celestia.NewCelestia(home)
case config.Avail:
dalayer = avail.NewAvail(home)
case config.Mock:
case config.Local:
dalayer = &damock.DAMock{}
default:
panic("Unknown data layer type")
Expand Down
2 changes: 1 addition & 1 deletion data_layer/damock/damock.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (d *DAMock) SetMetricsEndpoint(endpoint string) {
}

func (d *DAMock) GetStatus(c config.RollappConfig) string {
return "Running mock DA"
return "Running local DA"
}

func NewDAMock() *DAMock {
Expand Down

0 comments on commit 09a18aa

Please sign in to comment.