@Test @SuppressWarnings("unchecked") public void testDecodeStaticArrayValue() { List<TypeReference<Type>> outputParameters = new ArrayList<>(1); outputParameters.add((TypeReference) new TypeReference.StaticArrayTypeReference<StaticArray<Uint256>>(2) {}); outputParameters.add((TypeReference) new TypeReference<Uint256>() {}); List<Type> decoded = FunctionReturnDecoder.decode( "0x0000000000000000000000000000000000000000000000000000000000000037" + "0000000000000000000000000000000000000000000000000000000000000001" + "000000000000000000000000000000000000000000000000000000000000000a", outputParameters); List<Type> expected = Arrays.asList( new StaticArray<>(new Uint256(BigInteger.valueOf(55)), new Uint256(BigInteger.ONE)), new Uint256(BigInteger.TEN)); assertThat(decoded, equalTo(expected)); }
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);  }