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
The problem is that the class generated is not correct, here is the class:
import java.lang.String;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Future;
import org.web3j.abi.Contract;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Bytes32;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.abi.datatypes.generated.Uint8;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
/**
* <p>Auto generated code.<br>
* <strong>Do not modifiy!</strong><br>
* Please use {@link org.web3j.codegen.SolidityFunctionWrapperGenerator} to update.</p>
*/
public final class Test extends Contract {
private static final String BINARY = "606060405261015c806100126000396000f3606060405260e060020a6000350463d51cd4ac811461001e575b610002565b3461000257600060208190526004803582526040909120805460018201546002830154600384015494840154600585015460078601546100869773ffffffffffffffffffffffffffffffffffffffff96871697969095169593949360ff909316926006019088565b6040805173ffffffffffffffffffffffffffffffffffffffff808b16825289166020820152908101879052606081018690526080810185905260a0810184905260e0810182905261010060c082018181528454600260018216158402600019019091160491830182905290610120830190859080156101465780601f1061011b57610100808354040283529160200191610146565b820191906000526020600020905b81548152906001019060200180831161012957829003601f168201915b5050995050505050505050505060405180910390f3";
private Test(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
super(contractAddress, web3j, credentials, gasPrice, gasLimit);
}
public <T extends Type> Future<List<T>> shipments(Address param0) {
Function function = new Function<Bytes32>("shipments",
Arrays<Type>.asList(param0),
Arrays<TypeReference<?>>.asList(new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint8>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bytes32>() {}));
return executeCallMultipleValueReturnAsync(function);
}
public static Future<Test> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, BigInteger initialValue) {
return deployAsync(Test.class, web3j, credentials, gasPrice, gasLimit, BINARY, "", initialValue);
}
public static Test load(String contractAddress, Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
return new Test(contractAddress, web3j, credentials, gasPrice, gasLimit);
}
}
The List of TypeReference is giving error.
This is the part of code that is giving error: Arrays<Type>.asList(param0), Arrays<TypeReference<?>>.asList(new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint8>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bytes32>() {}));
The text was updated successfully, but these errors were encountered:
Hi, I'm using web3j v.1.0.6
I created this test Smart Contract:
The ABI of this Smart Contract is:
And the compiled code is:
606060405261015c806100126000396000f3606060405260e060020a6000350463d51cd4ac811461001e575b610002565b3461000257600060208190526004803582526040909120805460018201546002830154600384015494840154600585015460078601546100869773ffffffffffffffffffffffffffffffffffffffff96871697969095169593949360ff909316926006019088565b6040805173ffffffffffffffffffffffffffffffffffffffff808b16825289166020820152908101879052606081018690526080810185905260a0810184905260e0810182905261010060c082018181528454600260018216158402600019019091160491830182905290610120830190859080156101465780601f1061011b57610100808354040283529160200191610146565b820191906000526020600020905b81548152906001019060200180831161012957829003601f168201915b5050995050505050505050505060405180910390f3
The problem is that the class generated is not correct, here is the class:
The List of TypeReference is giving error.
This is the part of code that is giving error:
Arrays<Type>.asList(param0), Arrays<TypeReference<?>>.asList(new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint8>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Bytes32>() {}));
The text was updated successfully, but these errors were encountered: