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: increase necessary balance #1136

Merged
merged 6 commits into from
Nov 26, 2024
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
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
Loading