Skip to content
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

Android support milestone2 #73

Open
wants to merge 41 commits into
base: master
Choose a base branch
from

Conversation

nschwermann
Copy link
Contributor

Milestone 2 of Android Support

w3f/Grants-Program#573

Resolves:
#42
#45
#47
#59
#70

@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2021

Codecov Report

Merging #73 (546b38e) into master (ce1454e) will increase coverage by 1.04%.
The diff coverage is 86.24%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #73      +/-   ##
============================================
+ Coverage     87.35%   88.39%   +1.04%     
- Complexity      939      971      +32     
============================================
  Files           119      122       +3     
  Lines          3170     3394     +224     
  Branches        447      461      +14     
============================================
+ Hits           2769     3000     +231     
+ Misses          284      260      -24     
- Partials        117      134      +17     
Impacted Files Coverage Δ
...va/io/emeraldpay/polkaj/schnorrkel/Schnorrkel.java 86.66% <ø> (ø)
...raldpay/polkaj/schnorrkel/SchnorrkelException.java 20.00% <ø> (ø)
.../java/io/emeraldpay/polkaj/tx/ExtrinsicSigner.java 85.71% <0.00%> (-2.53%) ⬇️
...c/main/java/io/emeraldpay/polkaj/api/RpcCoder.java 86.66% <42.85%> (-13.34%) ⬇️
...emeraldpay/polkaj/schnorrkel/SchnorrkelNative.java 73.52% <50.00%> (ø)
...dpay/polkaj/api/internal/SubscriptionResponse.java 60.00% <60.00%> (ø)
...emeraldpay/polkaj/api/internal/DecodeResponse.java 77.39% <80.00%> (ø)
...io/emeraldpay/polkaj/apiokhttp/OkHttpRpcAdapter.kt 89.61% <89.61%> (ø)
...dpay/polkaj/apiokhttp/OkHttpSubscriptionAdapter.kt 90.50% <90.50%> (ø)
.../io/emeraldpay/polkaj/apihttp/JavaHttpAdapter.java 80.20% <90.90%> (+0.20%) ⬆️
... and 12 more

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 ce1454e...546b38e. Read the comment docs.

@nschwermann
Copy link
Contributor Author

Seems the timeout on websocket tests may need adjusted further for these github actions.

@nschwermann
Copy link
Contributor Author

@splix get a chance to look?

@splix
Copy link
Owner

splix commented Nov 5, 2021

@nschwermann hi, I've made couple of comments to the code, can you take a look? see above

@nschwermann
Copy link
Contributor Author

Hey @splix I am not seeing any comments?

JavaType type = objectMapper.getTypeFactory().constructParametricType(RpcResponse.class, clazz);
RpcResponse<T> response;
try {
response = objectMapper.readerFor(type).readValue(content);
if(content instanceof String) response = objectMapper.readerFor(type).readValue((String)content);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that instanceof is a good idea here. Maybe you can use InputStream as a default type, and wrap String to an InputStream in decode(int id, String content, JavaType clazz). That should be more effective and less error prone.

SecureRandom secureRandom;
try{
try{
SecureRandom.class.getMethod("getInstanceStrong");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure this line is needed?

@splix
Copy link
Owner

splix commented Nov 5, 2021

Oh, apparently I didn't click "Request Changes" button and it turns out without it you don't see the comments though I've made them like a month ago. Sorry about that

@nschwermann
Copy link
Contributor Author

LOL @splix no worries man I saw when I submit you were on vacation so I didn't poke you! I was thinking I need to start vacationing like you do!

@nschwermann
Copy link
Contributor Author

Feedback looks good, good catches I will get those resolved asap wrapping up another project atm.

@splix
Copy link
Owner

splix commented May 20, 2022

Hi @nschwermann. Just wondering if you're still working on it. Or maybe someone else could quickly fix those things and I can merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants