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

Static Arrays #183

Merged
merged 5 commits into from Oct 13, 2017

Conversation

Projects
None yet
2 participants
@jaycarey
Contributor

jaycarey commented Oct 9, 2017

Added new set of generated types (StaticArray#) to represent the size of static arrays up to length 32. Beyond that, the code will fall back to using the usual 'StaticArray' without the length suffix.

This should fix problems where the wrappers that call EVM methods that return static arrays throw invalid cast exceptions such as #167.

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Oct 9, 2017

Codecov Report

Merging #183 into master will decrease coverage by <.01%.
The diff coverage is 82.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #183      +/-   ##
============================================
- Coverage     79.36%   79.36%   -0.01%     
- Complexity     1466     1478      +12     
============================================
  Files           195      196       +1     
  Lines          5291     5349      +58     
  Branches        873      877       +4     
============================================
+ Hits           4199     4245      +46     
- Misses          898      909      +11     
- Partials        194      195       +1
Impacted Files Coverage Δ Complexity Δ
...e/src/main/java/org/web3j/abi/datatypes/Array.java 48.38% <ø> (ø) 8 <0> (ø) ⬇️
...ava/org/web3j/codegen/SolidityFunctionWrapper.java 98.95% <100%> (+0.01%) 87 <1> (+1) ⬆️
...main/java/org/web3j/codegen/AbiTypesGenerator.java 98.38% <100%> (+0.42%) 16 <2> (+2) ⬆️
...main/java/org/web3j/abi/FunctionReturnDecoder.java 65.95% <16.66%> (-10.24%) 12 <0> (ø)
core/src/main/java/org/web3j/abi/TypeDecoder.java 70.17% <60%> (-0.74%) 31 <1> (+1)
...main/java/org/web3j/abi/datatypes/StaticArray.java 81.81% <77.77%> (-18.19%) 9 <7> (+7)
...tocol/geth/methods/response/PersonalEcRecover.java
...rity/methods/response/ParityAddressesResponse.java
...a/org/web3j/protocol/admin/JsonRpc2_0Personal.java
...tocol/parity/methods/response/BooleanResponse.java
... and 45 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 d809866...e3abe9b. Read the comment docs.

codecov bot commented Oct 9, 2017

Codecov Report

Merging #183 into master will decrease coverage by <.01%.
The diff coverage is 82.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #183      +/-   ##
============================================
- Coverage     79.36%   79.36%   -0.01%     
- Complexity     1466     1478      +12     
============================================
  Files           195      196       +1     
  Lines          5291     5349      +58     
  Branches        873      877       +4     
============================================
+ Hits           4199     4245      +46     
- Misses          898      909      +11     
- Partials        194      195       +1
Impacted Files Coverage Δ Complexity Δ
...e/src/main/java/org/web3j/abi/datatypes/Array.java 48.38% <ø> (ø) 8 <0> (ø) ⬇️
...ava/org/web3j/codegen/SolidityFunctionWrapper.java 98.95% <100%> (+0.01%) 87 <1> (+1) ⬆️
...main/java/org/web3j/codegen/AbiTypesGenerator.java 98.38% <100%> (+0.42%) 16 <2> (+2) ⬆️
...main/java/org/web3j/abi/FunctionReturnDecoder.java 65.95% <16.66%> (-10.24%) 12 <0> (ø)
core/src/main/java/org/web3j/abi/TypeDecoder.java 70.17% <60%> (-0.74%) 31 <1> (+1)
...main/java/org/web3j/abi/datatypes/StaticArray.java 81.81% <77.77%> (-18.19%) 9 <7> (+7)
...tocol/geth/methods/response/PersonalEcRecover.java
...rity/methods/response/ParityAddressesResponse.java
...a/org/web3j/protocol/admin/JsonRpc2_0Personal.java
...tocol/parity/methods/response/BooleanResponse.java
... and 45 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 d809866...e3abe9b. Read the comment docs.

@conor10

This comment has been minimized.

Show comment
Hide comment
@conor10

conor10 Oct 11, 2017

Collaborator

Great stuff.

My only comment is that I think there should be an invariant that ensures the size of the list or array wrapped by the StaticArrayN matches what is expected. There is something similar in the IntType already.

Collaborator

conor10 commented Oct 11, 2017

Great stuff.

My only comment is that I think there should be an invariant that ensures the size of the list or array wrapped by the StaticArrayN matches what is expected. There is something similar in the IntType already.

@conor10 conor10 merged commit aa7917f into web3j:master Oct 13, 2017

3 checks passed

codecov/patch 82.25% of diff hit (target 79.36%)
Details
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +2.89% compared to d809866
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@conor10

This comment has been minimized.

Show comment
Hide comment
@conor10

conor10 Oct 13, 2017

Collaborator

Awesome thanks.

Collaborator

conor10 commented Oct 13, 2017

Awesome thanks.

franz-see pushed a commit to franz-see/web3j that referenced this pull request Aug 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment