-
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
[R4R] Add delist feature #575
Conversation
3860711
to
d6d29a8
Compare
|
||
am.SetAccount(ctx, acc) | ||
|
||
msg := NewNewOrderMsg(addr, "123456", Side.BUY, "XYZ-000_BNB", 1e6, 1e6) |
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.
the test cases here insert to different price level, try put multiple orders into same price level I guess there would be problem when you delete...
plugins/dex/plugin.go
Outdated
// deposit period: 1 day | ||
// voting period: 14 day | ||
// delayed days: 3 day | ||
const DaysToSearchForDelist = 20 |
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.
can we put a constrain/check on delist proposal that voting period should not exceed 14 days in case we miss search delist proposal?
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.
voting period should less than 14days, that's a constraint when creating a proposal
10a673f
to
74aae58
Compare
74aae58
to
d92a698
Compare
|
||
passedTime := proposal.GetVotingStartTime().Add(proposal.GetVotingPeriod()) | ||
timeToDelist := passedTime.Add(DelayedDaysForDelist * 24 * time.Hour) | ||
if timeToDelist.Before(blockTime) { |
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.
create an else branch and log an error...
it seems an error case that IsExecuted
is false but timeToDelist is after blocktime
plugins/dex/store/mapper.go
Outdated
@@ -114,6 +132,65 @@ func (m mapper) UpdateTickSizeAndLotSize(ctx sdk.Context, pair types.TradingPair | |||
return tickSize, lotSize | |||
} | |||
|
|||
func (m mapper) CanListTradingPair(ctx sdk.Context, baseAsset, quoteAsset string) error { |
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.
since we have both mapper and keeper, and for now the mapper only contains the low-level db operation. so can we put CanDelistTradingPair
and CanDelistTradingPair
in the keeper?
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
* add delist feature * implement delist function * update * add unit test for list hooks * add delist unit test * add pair mapper unit tests * update * update test * remove delayed days * fix small issues * refactor * refactor * check delist constraints before doing it * remove panic * change days back * expand proposal search time range * add pub test * add is delisted param * get max deposit period from store * add upgrade config * update dependency * move methods in mapper to keeper * fix imports
Description
ref: https://github.com/binance-chain/docs-internal/wiki/Delisting
cosmos change: bnb-chain/bnc-cosmos-sdk#129
Rationale
tell us why we need these changes...
Example
add an example CLI or API response...
Changes
Notable changes:
Preflight checks
make build
)make test
)make integration_test
)Already reviewed by
...
Related issues
... reference related issue #'s here ...