Skip to content

Commit

Permalink
fix: increase necessary balance (#1136)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Nov 26, 2024
1 parent 29745b9 commit af0dab9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
9 changes: 5 additions & 4 deletions cmd/consts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import (
)

const (
binsDir = "/usr/local/bin"
DefaultTokenSupply = "1000000000000000000000000000"
DefaultFee = 2000000000000000000 // 2
DefaultTxFee = 10000000000000000 // 0.01
binsDir = "/usr/local/bin"
DefaultTokenSupply = "1000000000000000000000000000"
DefaultFee = 2000000000000000000 // 2
DefaultTxFee = 10000000000000000 // 0.01
DefaultAdditionalFunding = "10000000000000000000" // 10, this amount is added to the necessary sequencer balance
)

var InternalBinsDir = fmt.Sprintf("%s/roller_bins", binsDir)
Expand Down
2 changes: 1 addition & 1 deletion cmd/consts/dymension.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const (
const (
MockHubID = "mock"
LocalHubID = "dymension_100-1"
PlaygroundHubID = "dymension_2019-1"
PlaygroundHubID = "dymension_1405-1"
TestnetHubID = "blumbus_111-1"
MainnetHubID = "dymension_1100-1"
)
25 changes: 22 additions & 3 deletions cmd/rollapp/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,26 @@ RollApp's IRO time: %v`,
cosmossdkmath.NewInt(consts.DefaultTxFee),
)

af, _ := cosmossdkmath.NewIntFromString(consts.DefaultAdditionalFunding)
necessaryBalance = necessaryBalance.Add(
af,
)

blnc, _ := sequencer.BaseDenomToDenom(*balance, 18)
oneDym, _ := cosmossdkmath.NewIntFromString("1000000000000000000")

nb := cosmossdktypes.Coin{
Denom: consts.Denoms.Hub,
Amount: necessaryBalance.Add(oneDym),
}
necBlnc, _ := sequencer.BaseDenomToDenom(nb, 18)

pterm.Info.Printf(
"current balance: %s\nnecessary balance: %s\n",
"current balance: %s (%s)\nnecessary balance: %s (%s)\n",
balance.String(),
blnc.String(),
fmt.Sprintf("%s%s", necessaryBalance.String(), consts.Denoms.Hub),
necBlnc.String(),
)

// check whether balance is bigger or equal to the necessaryBalance
Expand Down Expand Up @@ -303,11 +319,14 @@ RollApp's IRO time: %v`,
pterm.Error.Println("failed to get address balance: ", err)
return
}
blnc, _ = sequencer.BaseDenomToDenom(*balance, 18)

pterm.Info.Printf(
"current balance: %s\nnecessary balance: %s\n",
"current balance: %s (%s)\nnecessary balance: %s (%s)\n",
balance.String(),
blnc.String(),
fmt.Sprintf("%s%s", necessaryBalance.String(), consts.Denoms.Hub),
necBlnc.String(),
)

// check whether balance is bigger or equal to the necessaryBalance
Expand Down Expand Up @@ -762,7 +781,7 @@ func populateSequencerMetadata(raCfg roller.RollappConfig) error {
X: "",
}

var defaultGasPrice cosmossdktypes.Int
var defaultGasPrice cosmossdkmath.Int
var ok bool

if raCfg.HubData.GasPrice != "" {
Expand Down

0 comments on commit af0dab9

Please sign in to comment.