From 643ee6859909f7471cd60577fbfaab904b4a045a Mon Sep 17 00:00:00 2001 From: George Date: Mon, 27 Apr 2020 20:52:23 +0800 Subject: [PATCH] order and group upgrade config --- app/app.go | 1 + app/config/config.go | 6 ++++-- common/upgrade/upgrade.go | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index e0acc38ea..be0bb4317 100644 --- a/app/app.go +++ b/app/app.go @@ -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()) diff --git a/app/config/config.go b/app/config/config.go index e63c78a33..461f82b6f 100644 --- a/app/config/config.go +++ b/app/config/config.go @@ -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"] @@ -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"` @@ -376,6 +377,7 @@ type UpgradeConfig struct { FixZeroBalanceHeight int64 `mapstructure:"FixZeroBalanceHeight"` BEP67Height int64 `mapstructure:"BEP67Height"` + BEP70Height int64 `mapstructure:"BEP70Height"` } func defaultUpgradeConfig() *UpgradeConfig { @@ -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, } } diff --git a/common/upgrade/upgrade.go b/common/upgrade/upgrade.go index e52beb71a..d18a3e8b2 100644 --- a/common/upgrade/upgrade.go +++ b/common/upgrade/upgrade.go @@ -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 @@ -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()) {