Improved (dynamic) arrays of structs support
What does this PR do?
Currently dynamic arrays of structs in
- function parameters
- event parameters
- fields of other structs
- return values of functions
- return values of events
either produce an exception or non-compilable Java code.
Where should the reviewer start?
-
StructArray.solandStructArray2.soltest contracts covering the functionality in question -
abi/src/main/java/org/web3j/abi/datatypes/DynamicStruct.javawas preventing proper signature calculation with dynamic arrays
Why is it needed?
To be able to generate code for complicated contracts which use dynamic arrays of structs.
Review, anyone? @andrii-kl
I also created similar PR https://github.com/web3j/web3j/pull/1742 but only about Encoder part.
This contains my PR features. So once this merged earlier than mine, I will close mine : https://github.com/web3j/web3j/pull/1742
Hopefully, they are merged as soon as possible whether it is first.
tests are failing, please run gradle build locally and check what are the issues
tests are failing, please run gradle build locally and check what are the issues
My build succeeds locally. Any advice? @gtebrean
~ web3j % git status
On branch fix/arrays_of_structs
Your branch is up to date with 'origin/fix/arrays_of_structs'.
nothing to commit, working tree clean
~ web3j % ./gradlew clean && ./gradlew check jacocoTestReport
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
> Task :clean
...
> Task :utils:clean
BUILD SUCCESSFUL in 6s
15 actionable tasks: 15 executed
....
> Task :rlp:jacocoTestReport
> Task :tuples:jacocoTestReport SKIPPED
> Task :utils:jacocoTestReport
BUILD SUCCESSFUL in 1m 4s
206 actionable tasks: 204 executed, 2 up-to-date
tests are failing, please run gradle build locally and check what are the issues
My build succeeds locally. Any advice? @gtebrean
~ web3j % git status On branch fix/arrays_of_structs Your branch is up to date with 'origin/fix/arrays_of_structs'. nothing to commit, working tree clean ~ web3j % ./gradlew clean && ./gradlew check jacocoTestReport Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details > Task :clean ... > Task :utils:clean BUILD SUCCESSFUL in 6s 15 actionable tasks: 15 executed .... > Task :rlp:jacocoTestReport > Task :tuples:jacocoTestReport SKIPPED > Task :utils:jacocoTestReport BUILD SUCCESSFUL in 1m 4s 206 actionable tasks: 204 executed, 2 up-to-date
please run ./gradlew build
@gtebrean I figured it out, there was an incorrect folder name for case sensitive FS. Now tests should pass, could you please run actions again?
😴
any update?
Lol, I created another PR for the same encoder issue and I was going to create another one for the event part: https://github.com/web3j/web3j/pull/1774
After 3 PRs can we finally merge the fix and publish a new release, please?
very very very
NICE !
hope to be adopted soon!
Apparently, this project is dead. Just fork this branch guys and build it yourself.
Hi guys - the project is definitely not dead, but the team has had a busy few weeks with some of our other commitments. My apologies on their behalf. I'll get someone to get this done — I really appreciate folk taking the time to submit PRs.
Pushed the change addressing the issues above
@kberezin-p6 it seems that a test failed in the pipe... please check org.web3j.protocol.scenarios.FastRawTransactionManagerIT > testTransactionPolling() FAILED
@gtebrean it reliably passes on my machine. Looks like it's flaking. Can we re-run?
@kberezin-p6 I re run it but is still failing...we will also start to look at
@gtebrean yeah, because I see that it currently fails in master here and here, for example.
I've also checked out the latest master locally and
- ran all integration tests in
masterand they passed - ran all integration tests in this branch rebased on top of the latest
masterand they passed also.
Definitely something is wrong there
@gtebrean by the way, our fork's workflow runs also started to fail as soon as I synced master branches: example
@kberezin-p6 I've pushed a temporary fix to ignore the failing integration test in master, are you please able to rebase so I can rerun checks before the merge?
@mohamedelshami I've rebased the branch on top of the latest master. Please run the tests again.
Thanks, @kberezin-p6. There is a build error due to spottlessApply check. Could you run ./gradlew spotlessApply please and commit again?
Apologies, this workflow should probably improve to make this check part of a commit hook insted.
@mohamedelshami done