@Test public void testFunctionEmptyStringResultDecode() { Function function = new Function("test", Collections.emptyList(), Collections.singletonList(new TypeReference<Utf8String>() { })); List<Type> utf8Strings = FunctionReturnDecoder.decode( "0x0000000000000000000000000000000000000000000000000000000000000020" + "0000000000000000000000000000000000000000000000000000000000000000", function.getOutputParameters()); assertThat(utf8Strings.get(0).getValue(), is("")); }
public static List<Type> decode( String rawInput, List<TypeReference<Type>> outputParameters) { String input = Numeric.cleanHexPrefix(rawInput); if (Strings.isEmpty(input)) { 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 (Strings.isEmpty(input)) { 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 (Strings.isEmpty(input)) { 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 (Strings.isEmpty(input)) { 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 (Strings.isEmpty(input)) { 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);  }