Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change default confirm value to false for all interactions #921

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ on:
workflow_dispatch:
jobs:
end_to_end_test:
runs-on: ["self-hosted"]
runs-on: ["ubuntu-latest"]
env:
GOPRIVATE: "github.com/dymensionxyz/*"
GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}"
ROLLER_CONFIG_PATH: "${{ github.workspace }}/tmp/e2e_roller_config" # Setting the environment variable
ROLLAPP_ID: "endtoend_1-${{ github.run_number }}"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: git config --global url.https://[email protected]/.insteadOf https://github.com/
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ on:
- v*
branches:
- main
paths:
- '**/*.go'
- go.mod
- go.sum
# paths:
# - '**/*.go'
# - go.mod
# - go.sum
pull_request:
paths:
- '**/*.go'
- go.mod
- go.sum
# paths:
# - '**/*.go'
# - go.mod
# - go.sum
jobs:
golangci-lint:
name: lint
Expand All @@ -23,15 +23,17 @@ jobs:
GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}"
steps:
- run: git config --global url.https://[email protected]/.insteadOf https://github.com/
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.60.1
version: v1.61.0
only-new-issues: true
skip-cache: true
args: --allow-parallel-runners --timeout=5m
4 changes: 2 additions & 2 deletions .github/workflows/markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
- '**/*.md'
jobs:
markdownlint:
runs-on: ["self-hosted"]
runs-on: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: markdownlint-cli
uses: nosborn/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- id: release-please
name: Create release notes from conventional commits
uses: google-github-actions/release-please-action@v3
uses: google-github-actions/release-please-action@v4
with:
pull-request-header: ":loop: New roller Release"
release-type: go
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ jobs:
GOPRIVATE: "github.com/dymensionxyz/*"
GH_ACCESS_TOKEN: "${{ secrets.GH_ACCESS_TOKEN }}"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- run: git config --global url.https://[email protected]/.insteadOf https://github.com/

- name: Build
run: make build
# - name: Test & Coverage
Expand Down
9 changes: 5 additions & 4 deletions cmd/relayer/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ func Cmd() *cobra.Command {
for _, k := range keys {
k.Print(utils.WithName())
}
interactiveContinue, _ := pterm.DefaultInteractiveConfirm.WithDefaultText(
"Press enter when the keys are funded: ",
).WithDefaultValue(true).Show()
if !interactiveContinue {
proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultValue(false).
WithDefaultText(
"press 'y' when the wallets are funded funded",
).Show()
if !proceed {
return
}

Expand Down
69 changes: 33 additions & 36 deletions cmd/rollapp/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ func Cmd() *cobra.Command {
isMockFlagSet := cmd.Flags().Changed("mock")
shouldUseMockBackend, _ := cmd.Flags().GetBool("mock")

var raID string
if len(args) != 0 {
raID = args[0]
} else {
raID, _ = pterm.DefaultInteractiveTextInput.WithDefaultText(
"provide a rollapp ID that you want to run the node for",
).Show()
}

var hd consts.HubData
var env string

dymdBinaryOptions := dependencies.Dependency{
Name: "dymension",
Repository: "https://github.com/artemijspavlovs/dymension",
Expand All @@ -72,19 +60,12 @@ func Cmd() *cobra.Command {
return
}

var hd consts.HubData
var env string
var raID string

if shouldUseMockBackend {
env := "mock"
err = installBinaries("mock", true)
if err != nil {
pterm.Error.Println("failed to install binaries: ", err)
return
}
err := runInit(cmd, env, raID)
if err != nil {
fmt.Println("failed to run init: ", err)
return
}
return
env = "mock"
}

if !isMockFlagSet && !shouldUseMockBackend {
Expand All @@ -93,20 +74,36 @@ func Cmd() *cobra.Command {
WithDefaultText("select the environment you want to initialize for").
WithOptions(envs).
Show()
hd = consts.Hubs[env]
if env == "mock" {
err = installBinaries("mock", true)
if err != nil {
pterm.Error.Println("failed to install binaries: ", err)
return
}
err := runInit(cmd, env, raID)
if err != nil {
fmt.Println("failed to run init: ", err)
return
}
}
hd = consts.Hubs[env]

if len(args) != 0 {
raID = args[0]
} else {
raID, _ = pterm.DefaultInteractiveTextInput.WithDefaultText(
"provide a rollapp ID that you want to run the node for",
).Show()
}

pterm.Info.Println("validating RollApp ID: ", raID)
_, err = rollapp.ValidateChainID(raID)
if err != nil {
pterm.Error.Println("failed to validate chain id: ", err)
return
}

if env == "mock" {
err = installBinaries(env, true)
if err != nil {
pterm.Error.Println("failed to install binaries: ", err)
return
}
err := runInit(cmd, env, raID)
if err != nil {
fmt.Println("failed to run init: ", err)
return
}
return
}

// ex binaries install
Expand Down
15 changes: 7 additions & 8 deletions cmd/rollapp/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import (
cosmossdktypes "github.com/cosmos/cosmos-sdk/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
dymensionseqtypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"

initconfig "github.com/dymensionxyz/roller/cmd/config/init"
"github.com/dymensionxyz/roller/cmd/consts"
initrollapp "github.com/dymensionxyz/roller/cmd/rollapp/init"
Expand All @@ -34,6 +30,9 @@ import (
"github.com/dymensionxyz/roller/utils/errorhandling"
"github.com/dymensionxyz/roller/utils/rollapp"
sequencerutils "github.com/dymensionxyz/roller/utils/sequencer"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
)

// TODO: Test sequencing on 35-C and update the price
Expand Down Expand Up @@ -238,9 +237,9 @@ func Cmd() *cobra.Command {
pterm.DefaultSection.WithIndentCharacter("🔔").
Println("Please fund the addresses below to register and run the sequencer.")
seqAddrInfo.Print(utils.WithName())
proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultValue(true).
proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultValue(false).
WithDefaultText(
"press enter when funded",
"press 'y' when the wallets are funded funded",
).Show()

if !proceed {
Expand Down Expand Up @@ -305,9 +304,9 @@ func Cmd() *cobra.Command {
pterm.DefaultSection.WithIndentCharacter("🔔").
Println("Please fund the addresses below to register and run the sequencer.")
seqAddrInfo.Print(utils.WithName())
proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultValue(true).
proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultValue(false).
WithDefaultText(
"press enter when funded",
"press 'y' when funded",
).Show()

if !proceed {
Expand Down
5 changes: 3 additions & 2 deletions cmd/utils/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ func PrintInsufficientBalancesIfAny(
Println("Please fund the addresses below to register and run the sequencer.")
printAddresses()

proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultValue(true).
// TODO: to util
proceed, _ := pterm.DefaultInteractiveConfirm.WithDefaultValue(false).
WithDefaultText(
"press enter when funded",
"press 'y' when the wallets are funded funded",
).Show()
if !proceed {
pterm.Info.Println("exiting")
Expand Down
20 changes: 13 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
)

require (
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.3.0
github.com/BurntSushi/toml v1.4.0
github.com/briandowns/spinner v1.23.0
Expand Down Expand Up @@ -43,7 +44,6 @@ require (
cosmossdk.io/api v0.7.0 // indirect
cosmossdk.io/core v0.10.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/log v1.3.1 // indirect
cosmossdk.io/tools/rosetta v0.2.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
Expand All @@ -60,7 +60,7 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
Expand All @@ -76,6 +76,7 @@ require (
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/gogoproto v1.4.10 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.20.1 // indirect
github.com/cosmos/ibc-go/v7 v7.8.0 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
Expand All @@ -92,6 +93,7 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/badger/v3 v3.2103.2 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/distribution/reference v0.6.0 // indirect
Expand All @@ -113,11 +115,13 @@ require (
github.com/go-stack/stack v1.8.1 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/glog v1.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/flatbuffers v23.5.26+incompatible // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gookit/color v1.5.4 // indirect
Expand Down Expand Up @@ -182,6 +186,7 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tendermint/tm-db v0.6.8-0.20220506192307-f628bb5dc95b // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
Expand All @@ -191,6 +196,7 @@ require (
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
Expand All @@ -202,14 +208,14 @@ require (
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand All @@ -226,7 +232,7 @@ replace (
github.com/evmos/ethermint => github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20240625101522-b1506ae83050
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/osmosis-labs/osmosis/osmomath => github.com/dymensionxyz/osmosis/osmomath v0.0.6-dym-v0.0.1
github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.1-0.20240627111157-f2243f47cdb3
github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2

// broken goleveldb
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
Expand Down
Loading
Loading