-
Notifications
You must be signed in to change notification settings - Fork 41
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
BEP70 - Support busd pair listing and trading #710
Merged
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
57b3caa
add busd pair support
fc1ffd4
support busd pairs for listing and trading
ddbeca3
add more test cases
8ed1e06
change SupportedListSymbols[] to single BUSDSymbol
0e46d38
extract methods; update BEP number
018598e
refactor
65ae54a
refactor keeper
53e2c6e
busd fee refactor
rickyyangz 7b9e938
Merge pull request #722 from binance-chain/busd
forcodedancing ba142c2
add check
c1fa20a
Merge branch 'develop' into support_busd
forcodedancing 72f09d9
order and group upgrade config
5d9010b
order and group upgrade config
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ BEP6Height = {{ .UpgradeConfig.BEP6Height }} | |
BEP9Height = {{ .UpgradeConfig.BEP9Height }} | ||
# Block height of BEP10 upgrade | ||
BEP10Height = {{ .UpgradeConfig.BEP10Height }} | ||
# Block height of BEP19Height upgrade | ||
# Block height of BEP19 upgrade | ||
BEP19Height = {{ .UpgradeConfig.BEP19Height }} | ||
# Block height of BEP12 upgrade | ||
BEP12Height = {{ .UpgradeConfig.BEP12Height }} | ||
|
@@ -67,6 +67,8 @@ LotSizeUpgradeHeight = {{ .UpgradeConfig.LotSizeUpgradeHeight }} | |
ListingRuleUpgradeHeight = {{ .UpgradeConfig.ListingRuleUpgradeHeight }} | ||
# Block height of FixZeroBalanceHeight upgrade | ||
FixZeroBalanceHeight = {{ .UpgradeConfig.FixZeroBalanceHeight }} | ||
# Block height of BEP70 upgrade | ||
BEP70Height = {{ .UpgradeConfig.BEP70Height }} | ||
# Block height of BEP67 upgrade | ||
BEP67Height = {{ .UpgradeConfig.BEP67Height }} | ||
|
||
|
@@ -154,6 +156,10 @@ logFileRoot = "{{ .LogConfig.LogFileRoot }}" | |
logFilePath = "{{ .LogConfig.LogFilePath }}" | ||
# Number of logs keep in memory before writing to file | ||
logBuffSize = {{ .LogConfig.LogBuffSize }} | ||
|
||
[dex] | ||
# The suffixed symbol of BUSD | ||
BUSDSymbol = "{{ .DexConfig.BUSDSymbol }}" | ||
` | ||
|
||
type BinanceChainContext struct { | ||
|
@@ -180,6 +186,7 @@ type BinanceChainConfig struct { | |
*BaseConfig `mapstructure:"base"` | ||
*UpgradeConfig `mapstructure:"upgrade"` | ||
*QueryConfig `mapstructure:"query"` | ||
*DexConfig `mapstructure:"dex"` | ||
} | ||
|
||
func DefaultBinanceChainConfig() *BinanceChainConfig { | ||
|
@@ -190,6 +197,7 @@ func DefaultBinanceChainConfig() *BinanceChainConfig { | |
BaseConfig: defaultBaseConfig(), | ||
UpgradeConfig: defaultUpgradeConfig(), | ||
QueryConfig: defaultQueryConfig(), | ||
DexConfig: defaultGovConfig(), | ||
} | ||
} | ||
|
||
|
@@ -360,7 +368,9 @@ type UpgradeConfig struct { | |
// Hubble Upgrade | ||
BEP12Height int64 `mapstructure:"BEP12Height"` | ||
// Archimedes Upgrade | ||
BEP3Height int64 `mapstructure:"BEP3Height"` | ||
BEP3Height int64 `mapstructure:"BEP3Height"` | ||
BEP70Height int64 `mapstructure:"BEP70Height"` | ||
|
||
// TODO: add upgrade name | ||
FixSignBytesOverflowHeight int64 `mapstructure:"FixSignBytesOverflowHeight"` | ||
LotSizeUpgradeHeight int64 `mapstructure:"LotSizeUpgradeHeight"` | ||
|
@@ -379,6 +389,7 @@ func defaultUpgradeConfig() *UpgradeConfig { | |
BEP19Height: 1, | ||
BEP12Height: 1, | ||
BEP3Height: 1, | ||
BEP70Height: 1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
FixSignBytesOverflowHeight: math.MaxInt64, | ||
LotSizeUpgradeHeight: math.MaxInt64, | ||
ListingRuleUpgradeHeight: math.MaxInt64, | ||
|
@@ -397,6 +408,16 @@ func defaultQueryConfig() *QueryConfig { | |
} | ||
} | ||
|
||
type DexConfig struct { | ||
BUSDSymbol string `mapstructure:"BUSDSymbol"` | ||
} | ||
|
||
func defaultGovConfig() *DexConfig { | ||
return &DexConfig{ | ||
BUSDSymbol: "", | ||
} | ||
} | ||
|
||
func (context *BinanceChainContext) ParseAppConfigInPlace() error { | ||
// this piece of code should be consistent with bindFlagsLoadViper | ||
// vendor/github.com/tendermint/tendermint/libs/cli/setup.go:125 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
|
||
// TODO: add upgrade name | ||
FixSignBytesOverflow = sdk.FixSignBytesOverflow | ||
LotSizeOptimization = "LotSizeOptimization" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you put the config after bep67, we group these configs by upgrade name