0

I have a contract which has a field registry which is an array of addresses, Also have a getter for this field:

    function getRegistry() view public returns (address[] memory){
        return registry;
    }

. When I use web3j to generate Java wrappers for this code, I get:

        public RemoteCall<List> getRegistry() {
            final Function function = new Function(FUNC_GETREGISTRY, 
            Arrays.<Type>asList(), 
            Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<Address>>() {}));
            return new RemoteCall<List>(
            new Callable<List>() {
                @Override
                @SuppressWarnings("unchecked")
                public List call() throws Exception {
                    List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                    return convertToNative(result);
                }
            });
}

However I am unable to get the addresses from this field. contract.getRegistry() is apparently a RemoteCall<List> data type, and contract.getRegistry().send() causes an error:

{
  "timestamp": "2019-07-08",
  "status": 500,
  "error": "Internal Server Error",
  "message": "org/bouncycastle/jcajce/provider/digest/Keccak$Digest256",
  "path": "/api/getRegistry"
}

How can I access these addresses, or cast them into a string? Any idea on what I can do?

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.