python-graphenelib icon indicating copy to clipboard operation
python-graphenelib copied to clipboard

Add "readwire" interface to *some* Graphene Types.

Open jhtitor opened this issue 7 years ago • 3 comments
trafficstars

This is useful when you want to read the serialized wire protocol back into objects-in-memory. Although this is rarely used on the client side of graphene networks, at least one particular use case (BitShares blind transfers) exists.

To clarify: this is __bytes__ method in reverse.

The _readwire interface and method signature are pretty horrid, so some redesign might be required.

jhtitor avatar Apr 07 '18 05:04 jhtitor

Codecov Report

Merging #65 into develop will decrease coverage by 0.34%. The diff coverage is 87.3%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #65      +/-   ##
===========================================
- Coverage    98.69%   98.34%   -0.35%     
===========================================
  Files           24       24              
  Lines         1452     1515      +63     
  Branches       130      135       +5     
===========================================
+ Hits          1433     1490      +57     
- Misses          16       19       +3     
- Partials         3        6       +3
Impacted Files Coverage Δ
graphenebase/account.py 97.77% <100%> (+0.05%) :arrow_up:
graphenebase/types.py 96.46% <86.2%> (-2.65%) :arrow_down:
graphenestorage/masterpassword.py 100% <0%> (+2.43%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 49c196e...5be5038. Read the comment docs.

codecov-io avatar Apr 07 '18 05:04 codecov-io

Would it be possible to add unit tests for those?

xeroc avatar Apr 16 '18 08:04 xeroc

Instead of calling those methods _rewrite, can we have them fromBytes() and not begin with _. That makes it more obvious and corresponds better with the fromBuffer used in bitsharesJS

xeroc avatar Aug 09 '18 13:08 xeroc