You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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); }
The text was updated successfully, but these errors were encountered:
bigstar119
changed the title
auto generate wapper code problem
auto generate warpper code problem
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); }
The text was updated successfully, but these errors were encountered: