XRPLF / xrpl-py

A Python library to interact with the XRP Ledger (XRPL) blockchain
ISC License
151 stars 86 forks source link

`from_xrpl` should not accept snake_case dict keys #694

Closed ckeshava closed 5 months ago

ckeshava commented 8 months ago

BaseModel.from_xrpl method should not accept snake_case keys in dictionary input.

Fix #689 . You can find more context in the discussion pertaining to this issue.

I have used a regular expression matches for snake_case. If you have any other ideas for detecting non-camelCase input formats, let me know. There appears to be a variety of solutions for this problem, but all of them have slight differences in their behavior.

High Level Overview of Change

Context of Change

Type of Change

Did you update CHANGELOG.md?

Test Plan

ckeshava commented 8 months ago

The integration and snippet tests are not reliable. I'm observing these errors: (Integration Test Python 3.8): xrpl.asyncio.wallet.wallet_generation.XRPLFaucetException: Unable to fund address with faucet after waiting 40 seconds

Snippet test error: httpx.HTTPStatusError: Server error '502 Bad Gateway' for url 'https://faucet.altnet.rippletest.net/accounts'

ckeshava commented 8 months ago

@justinr1234 @khancode can you please review this at your convinience?

ckeshava commented 5 months ago

I have updated the regular-expression which is used to invalidate inputs in BaseModel. This was required after the introduction of the AMM feature. (AMM introduced a new type of key Amount2, with an integer in its wake -- this was breaking the regexp)

If anyone has objections pertaining to it, please let me know. It is not related to the changelist of this PR.