Skip to content

Commit

Permalink
separately deposit for upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
MalteHerrmann committed May 1, 2024
1 parent f865c45 commit 47d59a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func upgradeLocalNode(bin *utils.Binary, targetVersion string) error {

bin.Logger.Info().Msgf("scheduled upgrade to %s at height %d.\n", targetVersion, upgradeHeight)

if _, err = gov.Deposit(bin, []string{}); err != nil {
return errors.Wrapf(err, "error depositing for proposal %d", proposalID)
}

if err = gov.SubmitAllVotesForProposal(bin, proposalID); err != nil {
return errors.Wrapf(err, "error submitting votes for proposal %d", proposalID)
}
Expand Down
7 changes: 3 additions & 4 deletions gov/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import (
)

// buildUpgradeProposalCommand builds the command to submit a software upgrade proposal.
func buildUpgradeProposalCommand(targetVersion string, upgradeHeight int, denom string) []string {
func buildUpgradeProposalCommand(targetVersion string, upgradeHeight int) []string {
return []string{
"tx", "gov", "submit-legacy-proposal", "software-upgrade", targetVersion,
"--title", fmt.Sprintf("'Upgrade to %s'", targetVersion),
"--description", fmt.Sprintf("'Upgrade to %s'", targetVersion),
"--upgrade-height", strconv.Itoa(upgradeHeight),
"--deposit", "100000000000000000000" + denom,
"--output", "json",
"--no-validate",
}
Expand Down Expand Up @@ -79,11 +78,11 @@ func QueryLatestProposalID(bin *utils.Binary) (int, error) {

// SubmitUpgradeProposal submits a software upgrade proposal with the given target version and upgrade height.
func SubmitUpgradeProposal(bin *utils.Binary, targetVersion string, upgradeHeight int) (int, error) {
upgradeProposal := buildUpgradeProposalCommand(targetVersion, upgradeHeight, bin.Config.Denom)
upgradeProposal := buildUpgradeProposalCommand(targetVersion, upgradeHeight)

out, err := utils.ExecuteTx(bin, utils.TxArgs{
Subcommand: upgradeProposal,
From: "dev0",
From: bin.Accounts[0].Name,
})
if err != nil {
return 0, errors.Wrap(err,
Expand Down

0 comments on commit 47d59a8

Please sign in to comment.