@Test public void testSimpleFunctionStringResultDecode() { Function function = new Function("simple", Arrays.asList(), Collections.singletonList(new TypeReference<Utf8String>() { })); List<Type> utf8Strings = FunctionReturnDecoder.decode( "0x0000000000000000000000000000000000000000000000000000000000000020" + "000000000000000000000000000000000000000000000000000000000000000d" + "6f6e65206d6f72652074696d6500000000000000000000000000000000000000", function.getOutputParameters()); assertThat(utf8Strings.get(0).getValue(), is("one more time")); }
public static List<Type> decode( String rawInput, List<TypeReference<Type>> outputParameters) { String input = Numeric.cleanHexPrefix(rawInput); if (input.isEmpty()) { return Collections.emptyList(); } else { return build(input, outputParameters); } }
FunctionReturnDecoder { public static List<Type> decode( String rawInput, List<TypeReference<Type>> outputParameters) { String input = Numeric.cleanHexPrefix(rawInput); if (input.isEmpty()) { return Collections.emptyList(); } else { return build(input, outputParameters); } } }
FunctionReturnDecoder { public static List<Type> decode( String rawInput, List<TypeReference<Type>> outputParameters) { String input = Numeric.cleanHexPrefix(rawInput); if (input.isEmpty()) { return Collections.emptyList(); } else { return build(input, outputParameters); } } private  FunctionReturnDecoder(); }
FunctionReturnDecoder { public static List<Type> decode( String rawInput, List<TypeReference<Type>> outputParameters) { String input = Numeric.cleanHexPrefix(rawInput); if (input.isEmpty()) { return Collections.emptyList(); } else { return build(input, outputParameters); } } private  FunctionReturnDecoder(); static List<Type> decode(
            String rawInput, List<TypeReference<Type>> outputParameters); @SuppressWarnings("unchecked") static Type decodeIndexedValue(
            String rawInput, TypeReference<T> typeReference); }
FunctionReturnDecoder { public static List<Type> decode( String rawInput, List<TypeReference<Type>> outputParameters) { String input = Numeric.cleanHexPrefix(rawInput); if (input.isEmpty()) { return Collections.emptyList(); } else { return build(input, outputParameters); } } private  FunctionReturnDecoder(); static List<Type> decode(
            String rawInput, List<TypeReference<Type>> outputParameters); @SuppressWarnings("unchecked") static Type decodeIndexedValue(
            String rawInput, TypeReference<T> typeReference);  }