kotlin-ipv8 icon indicating copy to clipboard operation
kotlin-ipv8 copied to clipboard

Update Serialization.kt with auto functionality

Open Eragoneq opened this issue 1 year ago • 4 comments
trafficstars

Closes #87 Closes #86

(cherry picked from commit 3e4a42dc19910fe9d128c0034d754b94db0d343f)

This pull requests fixes the two mentioned issues or design flaws related to Int and UShort transit. If permitted, I would just change the signature of the original UShort functions and all the usages in the code to explicitly cast the data before sending to (de)serializer.

This also includes functions to automatically select the proper (de)serializer based on the underlying, allowing for more clean code in simple cases.

I was not able to automatically perform deserialization due to issues with typing of static classes and usage of Companion, as such it has been left out for now.

Eragoneq avatar Apr 09 '24 23:04 Eragoneq

File Coverage [78.03%] :x:
Serialization.kt 78.03% :x:
Total Project Coverage 64.76% :green_apple:

github-actions[bot] avatar Apr 09 '24 23:04 github-actions[bot]

Codecov Report

Attention: Patch coverage is 88.23529% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 58.73%. Comparing base (476dc36) to head (6ff3d74).

Files Patch % Lines
...in/java/nl/tudelft/ipv8/messaging/Serialization.kt 88.23% 6 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #88      +/-   ##
============================================
+ Coverage     58.62%   58.73%   +0.10%     
  Complexity      702      702              
============================================
  Files           107      107              
  Lines          4553     4553              
  Branches        632      632              
============================================
+ Hits           2669     2674       +5     
+ Misses         1552     1549       -3     
+ Partials        332      330       -2     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 10 '24 00:04 codecov[bot]

File Coverage [78.03%] :x:
Serialization.kt 78.03% :x:
Total Project Coverage 64.73% :green_apple:

github-actions[bot] avatar Apr 11 '24 11:04 github-actions[bot]

File Coverage [78.03%] :x:
Serialization.kt 78.03% :x:
Total Project Coverage 64.55% :green_apple:

github-actions[bot] avatar Apr 17 '24 12:04 github-actions[bot]