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
Get order book changes #407
Conversation
What do you mean by "the values just can get smaller"? (Would it always be negative in that case?) |
Correct. An offer offer object can only be consumed or cancelled. Basically there are four statuses an offer can have:
To make it short, the taker amounts can not get raised by the owner, they can only get consumed (get smaller). Despite that it would make sense to explicitly indicate that the |
That makes sense to me - It does strike me as odd that a |
@LimpidCrypto Sorry for the slow review time - This week has been incredibly busy with travel, and I'm out on vacation next week - I'll make sure to prioritize this when I'm back a week from Tuesday though! |
No rush. Enjoy your well earned vacation :) |
I'll review this tomorrow :) |
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.
LGTM (I asked for a second reviewer to look at this next week since tomorrow's an internal holiday for Ripplers :) )
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.
LGTM. Just left a comment related to filename casing. Great work! 🤠
tests/unit/utils/txn_parser/transaction_jsons/offer_partially-filled_and_filled.json
Outdated
Show resolved
Hide resolved
How do I resolve the linting error 'poetry run flake8 xrpl tests --darglint-ignore-regex="^_(.*)"'? |
@LimpidCrypto Generally you want to run the following three commands:
(The (If you open up the details of the error you mentioned above, it'll show that almost all the errors are "BLK would make changes" which means |
I tried that but still the same errors. It wonders me anyways because I did not even touch the files that cause these errors. |
Ok, I know the reason, but don't quite know the fix yet - It seems that the pre-commit hook is changing things back to a state that Black doesn't like automatically. (When you run Currently looking into why this is happening :) |
@LimpidCrypto so seems that there's an update to either Black or flake8-black, so if you do |
…pto/xrpl-py into get_order_book_changes
Great, thanks for your help @JST5000 :) |
High Level Overview of Change
get_order_book_changes
get_value
andgroup_by_account
to parser.pyFields
Context of Change
The #342 PR was splitted. For each exported function (get_balance_changes (already merged #383), get_final_balances (already merged #398), get_previous_balances and get_order_book_changes) there will now be a separate PR to make it easier to review. This PR adds the functionality to parse the order book changes from a transaction's metadata (get_order_book_changes).
Reference is: https://github.com/ripple/ripple-lib-extensions/blob/master/transactionparser/src/orderbookchanges.js
The return value is structured as the
get_balance_changes
andget_final_balances
return values.Type of Change
Test Plan
test_offer_created
test_offer_partially_filled_and_filled
test_offer_cancelled
test_offer_with_expiration
For Discussion
_calculate_delta
) the absolute value is returned. IMO it might be easier to understand if it is returned as a signed float ("value": "60" -> "value": "-60"), even though the values only can get smaller.account_objects
ingroup_by_account
.TODO