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

Adding support for multidimensional arrays arguments in the contract wrapper generator #404

Conversation

fergarrui
Copy link
Contributor

@fergarrui fergarrui commented Mar 3, 2018

This should fix #110 and fix #271 .
It also supports nested dynamic arrays. It won't compile in Solidity, but since that feature should be added in the future, it does not hurt to have it already here. For example:

uint256[][]

@codecov
Copy link

codecov bot commented Mar 3, 2018

Codecov Report

Merging #404 into master will increase coverage by 0.09%.
The diff coverage is 88.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #404      +/-   ##
============================================
+ Coverage     76.55%   76.64%   +0.09%     
- Complexity     1627     1632       +5     
============================================
  Files           215      215              
  Lines          6064     6092      +28     
  Branches        955      960       +5     
============================================
+ Hits           4642     4669      +27     
+ Misses         1193     1192       -1     
- Partials        229      231       +2
Impacted Files Coverage Δ Complexity Δ
abi/src/main/java/org/web3j/abi/Utils.java 81.96% <80%> (-0.39%) 19 <2> (+2)
...ava/org/web3j/codegen/SolidityFunctionWrapper.java 95.75% <92%> (-0.25%) 107 <1> (+3)
...ore/src/main/java/org/web3j/utils/Observables.java 80% <0%> (-4%) 9% <0%> (-1%)
...main/java/org/web3j/abi/datatypes/StaticArray.java 100% <0%> (+18.18%) 10% <0%> (+1%) ⬆️

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 0c0dc90...20a916c. Read the comment docs.

@conor10
Copy link
Contributor

conor10 commented Mar 5, 2018

Thanks @fergarrui - looks good so far. There's an additional piece of further testing that I'd like to have added.

The following tests generate smart contract wrappers and verify that the generated code compiles. Please can you update the existing Arrays.sol smart contract to use multi-dimensional arrays in addition to single as it currently does?

@conor10 conor10 merged commit d3cbb4b into hyperledger-web3j:master Mar 13, 2018
@conor10
Copy link
Contributor

conor10 commented Mar 13, 2018

Great work!

franz-see pushed a commit to franz-see/web3j that referenced this pull request Aug 3, 2018
…t-for-multidimensional-arrays-in-arguments

Adding support for multidimensional arrays arguments in the contract wrapper generator
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.

Wrong code generation for two-dimensional arrays auto generate warpper code problem
2 participants