Gelassen / swap

The idea behind this project is to give people an option to exchange products and services without money (barter).
0 stars 0 forks source link

Web3j struct related issues #12

Open Gelassen opened 1 year ago

Gelassen commented 1 year ago

Description

This information-only issue to track gained knowledge with struct related issues in the web3j. There are grown number of known issues in web3j which required to be written for the history.

web3j-cli autogenerate contract wrapper issue

I had issues to autogenerate wrappers for my contracts. Here is an opened issue. After the latest web3j-cli release I am able to generate wrapper for SwapValue.sol, but not for SwapChain.sol. Possible root cause is this contract uses struct with solidity address field. This post claims struct with address field is not supported yet by web3j.

RPC call from a mobile client with struct as an input param issue

When I do a call from a koltin code with a help of web3j to a solidity code, data in struct field is different from I have sent, e.g. valueOfTheFirstUser contains address of the user instead of expected tokenId and vice-versa. I have test coverage for this logic in type-script test and it works fine. Also I have a similar scenario in another contract and it works fine. The difference between struct input params in this two scenarios is the first one contains address field.

That's all for now.

Lokuslick commented 1 year ago

Any updates on this issue?

Gelassen commented 1 year ago

Any updates on this issue?

Yes, there is some more news. After further work I met a few more struct related issues: most of them were not documented and I do not remember details, but here is bug report related to the last of them and PR with test case to spot this issue.

Anyway, I was able to move forward by partly autogenerate my contracts and partly write wrappers on my own.