bitshares / bitshares-core

BitShares Blockchain node and command-line wallet
https://bitshares.github.io/
Other
1.17k stars 648 forks source link

Return blackswan settlement result in account history #1317

Closed kapeer42 closed 6 years ago

kapeer42 commented 6 years ago

User Story As a bitshares-ui developer I want to get the result of the settlement of an MPA that has blackswaned when I call get_account_history so that the issue https://github.com/bitshares/bitshares-ui/issues/1785 can be closed.

By 'result of the settlement' I mean 'how much MPA was traded for how much short_backing_asset'.

Impacts

Additional Context (optional) If this is not too complicated I could implement it myself with some hints for where to look for.

CORE TEAM TASK LIST

pmconrad commented 6 years ago

This code here https://github.com/bitshares/bitshares-core/blob/2.0.180823/libraries/chain/asset_evaluator.cpp#L858-L881 should create a virtual operation as in https://github.com/bitshares/bitshares-core/blob/2.0.180823/libraries/chain/db_market.cpp#L900 . Has an effect on operation history and should therefore be treated like a hardfork.

abitmore commented 6 years ago

@pmconrad IMHO line 881 return settled_amount; is enough for UI. https://github.com/bitshares/bitshares-core/blob/08e9e0a2cae514f5af31f2d60b7cf4710d471136/libraries/chain/asset_evaluator.cpp#L881

abitmore commented 6 years ago

@kapeer42 please paste your request/response json here. There should be something like "result":[2,{"amount":123,"asset_id":"1.3.0"}] in the result.

kapeer42 commented 6 years ago

I'm blind, thanks for the quick catch @abitmore, closing this. Sorry for any lost time.