Repository navigation
common: parse the raw rpc responses with python's own json, and fix the raw bindings - #154
mycomputercrashsalot wants to merge 6 commits into
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
🟢 Metrics 10 complexity · 3 duplication
Metric Results Complexity 10 Duplication 3
🟢 Coverage 98.65% diff coverage · -0.01% coverage variation
Metric Results Coverage variation ✅ -0.01% coverage variation (-1.00%) Diff coverage ✅ 98.65% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (1106331) 18075 16819 93.05% Head commit (50af3ab) 18182 (+107) 16916 (+97) 93.04% (-0.01%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#154) 148 146 98.65% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Thanks, there are some good fixes here, but I think this should be split up: These can go in now as a separate PR:
The Raw responses: agreed the property tree loses information, but I'd rather not subclass
|
e432765 to
bd4d840
Compare
the raw rpc responses went thru a boost property tree, wich erases the difference between {},
[] and "" before python sees anything: every empty container came back as a string. the two
json endpoints fetch the raw body now (a one line passthrough to the invoke the connection
already had, no envelope duplicated) and parse it with python's own json. {} is {}, [] is [],
"" is "", and every integer keeps its exact value at any magnitude, wich the old parse lost
past 2^53.
two things change for a caller that relied on the old shapes: malformed json raises
json.JSONDecodeError now (a ValueError, not a RuntimeError), and json null maps to None instead
of the string "null". nothing in the repo relied on either.
the old bindings also held the gil for the whole round trip, so any in-process python http peer
deadlocked on them. the gil is released around the fetch now.
the raw requests advertised a timeout_ms the bindings rejected - type checked code passed and
runtime raised TypeError. the bindings take it now and forward it to monero-cpp. one caveat the
stubs say out loud: the timeout is per request, the initial connection to a fresh host can
still take as long as the os lets it, and timeout_ms=0 means indefinite.
import_multisig_hex dropped refresh_after_import for python subclasses (the direct binding had
it, the trampoline didnt). re-assigning the same query to itself wiped the back reference wich
the guard in set_query already had. verify_message caught every exception, so an outage read as
"signature not good" - it catches the address errors now and lets the rest raise.
the suite: 70 passed, 2 xfailed, 1 environmental (a loopback response_time that reads 0ms - it
fails the same way on the tree before these changes).