Skip to content

Commit

Permalink
order and group upgrade config
Browse files Browse the repository at this point in the history
  • Loading branch information
George authored and forcodedancing committed May 19, 2022
1 parent fcbafdf commit 643ee68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func SetUpgradeConfig(upgradeConfig *config.UpgradeConfig) {
upgrade.Mgr.AddUpgradeHeight(upgrade.ListingRuleUpgrade, upgradeConfig.ListingRuleUpgradeHeight)
upgrade.Mgr.AddUpgradeHeight(upgrade.FixZeroBalance, upgradeConfig.FixZeroBalanceHeight)
upgrade.Mgr.AddUpgradeHeight(upgrade.BEP67, upgradeConfig.BEP67Height)
upgrade.Mgr.AddUpgradeHeight(upgrade.BEP70, upgradeConfig.BEP70Height)

// register store keys of upgrade
upgrade.Mgr.RegisterStoreKeys(upgrade.BEP9, common.TimeLockStoreKey.Name())
Expand Down
6 changes: 4 additions & 2 deletions app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ ListingRuleUpgradeHeight = {{ .UpgradeConfig.ListingRuleUpgradeHeight }}
FixZeroBalanceHeight = {{ .UpgradeConfig.FixZeroBalanceHeight }}
# Block height of BEP67 upgrade
BEP67Height = {{ .UpgradeConfig.BEP67Height }}
# Block height of BEP70 upgrade
BEP70Height = {{ .UpgradeConfig.BEP70Height }}
[query]
# ABCI query interface black list, suggested value: ["custom/gov/proposals", "custom/timelock/timelocks", "custom/atomicSwap/swapcreator", "custom/atomicSwap/swaprecipient"]
Expand Down Expand Up @@ -367,7 +369,6 @@ type UpgradeConfig struct {
BEP12Height int64 `mapstructure:"BEP12Height"`
// Archimedes Upgrade
BEP3Height int64 `mapstructure:"BEP3Height"`
BEP70Height int64 `mapstructure:"BEP70Height"`

// TODO: add upgrade name
FixSignBytesOverflowHeight int64 `mapstructure:"FixSignBytesOverflowHeight"`
Expand All @@ -376,6 +377,7 @@ type UpgradeConfig struct {
FixZeroBalanceHeight int64 `mapstructure:"FixZeroBalanceHeight"`

BEP67Height int64 `mapstructure:"BEP67Height"`
BEP70Height int64 `mapstructure:"BEP70Height"`
}

func defaultUpgradeConfig() *UpgradeConfig {
Expand All @@ -387,12 +389,12 @@ func defaultUpgradeConfig() *UpgradeConfig {
BEP19Height: 1,
BEP12Height: 1,
BEP3Height: 1,
BEP70Height: 1,
FixSignBytesOverflowHeight: math.MaxInt64,
LotSizeUpgradeHeight: math.MaxInt64,
ListingRuleUpgradeHeight: math.MaxInt64,
FixZeroBalanceHeight: math.MaxInt64,
BEP67Height: 1,
BEP70Height: 1,
}
}

Expand Down
5 changes: 3 additions & 2 deletions common/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const (
BEP12 = "BEP12" // https://github.com/binance-chain/BEPs/pull/17
// Archimedes Upgrade
BEP3 = "BEP3" // https://github.com/binance-chain/BEPs/pull/30
// BUSD Pair Upgrade
BEP70 = "BEP70" // supporting listing and trading BUSD pairs


// TODO: add upgrade name
FixSignBytesOverflow = sdk.FixSignBytesOverflow
Expand All @@ -27,6 +26,8 @@ const (
FixZeroBalance = "FixZeroBalance"

BEP67 = "BEP67" // https://github.com/binance-chain/BEPs/pull/67
// BUSD Pair Upgrade
BEP70 = "BEP70" // https://github.com/binance-chain/BEPs/pull/70
)

func UpgradeBEP10(before func(), after func()) {
Expand Down

0 comments on commit 643ee68

Please sign in to comment.