blockchainprojects / bitshares-ui

Graphical User Interface for BitShares Blockchain
https://wallet.bitshares.org
MIT License
0 stars 1 forks source link

There is a bug when resolving prediction markets #162

Open VerevkinAlexander opened 5 years ago

VerevkinAlexander commented 5 years ago

Describe the bug It's impossible to resolve predicton markets with settlement price equals to 0 at all, and with settlement price equals to 1 it's possible only if there were any buy orders in the market.

To Reproduce Steps to reproduce the behavior: 1) Create new prediction market: go to Menu -> Assets -> Create asset. 2) In "Primary settings" table set symbol, switch toggles "SmartCoin" and "Binary prediction market". 3) In description table set description, condition and market resolution date. Then click "Create asset" button and confirm transaction. 4) Then go to Explore -> Assets -> Prediction market assets, find your asset and click on its symbol to enter to the settings of the asset. 5) Click to Asset actions and find "Resolve prediction" section. 6) Select False, click Publish button and confirm. The transaction fails with exception Assert Exception: asset_to_settle->dynamic_data(d).current_supply > 0: Can not globally settle an asset with zero supply. 7) It's the same result with True resolution. 8) Go to Explore -> Assets -> Prediction market assets again, find your asset and click "Exchange" button. 9) Create sell order: set price (e.g. 1) and quantity (e.g. 1) and click "Sell" button. 10) Then try to resolve market again. In case of False resolvement it's Assert Exception: b.base.amount.value > 0: Although in True case it resolves succesfully. 11) Then create another asset, add a buy order (without sell orders) and try to resolve prediction market. In both cases of False or True resolvement it's Assert Exception: asset_to_settle->dynamic_data(d).current_supply > 0: Can not globally settle an asset with zero supply 12) Note, that there is a "unimplemented tx op" message in the console every time.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots 1 2

Desktop (please complete the following information):

Additional context It's the same behavior in our new prediction markets UI, because we use the same function to resolve markets.

@sschiessl-bcp