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

auto generate warpper code problem #110

Closed
bigstar119 opened this issue Jun 21, 2017 · 0 comments · Fixed by #404
Closed

auto generate warpper code problem #110

bigstar119 opened this issue Jun 21, 2017 · 0 comments · Fixed by #404

Comments

@bigstar119
Copy link

bigstar119 commented Jun 21, 2017

hi, i use web3j-2.2.1 auto generate wapper code found a problem ,if solidity function has an Multidimensional array args, auto generated wapper code is not good. for example:
solidity function:
function miniArgs(uint[2][] arg1,bytes names)
{
uint[] memory ids=new uint;
uint[] memory sexes=new uint;
for(uint i=0;i<arg1.length;i++)
{
ids[i]=arg1[i][0];
sexes[i]=arg1[i][1];
}
addBatch(ids,names,sexes);
}
}
auto generated wapper code(error):
public Future<TransactionReceipt> miniArgs(StaticArray<Uint256> arg1, DynamicBytes names) { Function function = new Function("miniArgs", Arrays.<Type>asList(arg1, names), Collections.<TypeReference<?>>emptyList()); return executeTransactionAsync(function); }

the right warpper code should be:
public Future<TransactionReceipt> miniArgs(DynamicArray<StaticArray<Uint256>> arg1, DynamicBytes names) { Function function = new Function("miniArgs", Arrays.<Type>asList(arg1, names), Collections.<TypeReference<?>>emptyList()); return executeTransactionAsync(function); }

@bigstar119 bigstar119 changed the title auto generate wapper code problem auto generate warpper code problem Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant