Skip to content

Commit

Permalink
Merge pull request #1810 from livepeer/nv/maxgas
Browse files Browse the repository at this point in the history
CLI: fix max gas price when not specified
  • Loading branch information
kyriediculous authored Apr 7, 2021
2 parents 4e24711 + ffb52de commit b29cb70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Unreleased Changes

## vX.X
## vX.X

### Bug Fixes 🐞

#### General

- \#1810 Display "n/a" in CLI when max gas price isn't specified (@kyriediculous)
6 changes: 5 additions & 1 deletion cmd/livepeer_cli/wizard_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ func (w *wizard) stats(showOrchestrator bool) {

lptBal, _ := new(big.Int).SetString(w.getTokenBalance(), 10)
ethBal, _ := new(big.Int).SetString(w.getEthBalance(), 10)
maxGasPriceStr := "n/a"
maxGasPrice, _ := new(big.Int).SetString(w.maxGasPrice(), 10)
if maxGasPrice != nil && maxGasPrice.Cmp(big.NewInt(0)) > 0 {
maxGasPriceStr = fmt.Sprintf("%v GWei", eth.FromWei(maxGasPrice, params.GWei))
}

table := tablewriter.NewWriter(os.Stdout)
data := [][]string{
Expand All @@ -60,7 +64,7 @@ func (w *wizard) stats(showOrchestrator bool) {
{"ETH Account", w.getEthAddr()},
{"LPT Balance", eth.FormatUnits(lptBal, "LPT")},
{"ETH Balance", eth.FormatUnits(ethBal, "ETH")},
{"Max Gas Price", fmt.Sprintf("%v GWei", eth.FromWei(maxGasPrice, params.GWei))},
{"Max Gas Price", maxGasPriceStr},
}

for _, v := range data {
Expand Down

0 comments on commit b29cb70

Please sign in to comment.