@Test public void ensureSignedInteger_isDecoded() { byte[] bigNumberByteArray = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 127, -1, -1, -1, -1, -1, -1, -1 }; SolidityType testObject = new SolidityType.IntType("int256"); Object decode = testObject.decode(bigNumberByteArray); assertEquals(decode.getClass(), BigInteger.class); BigInteger actualBigInteger = (BigInteger) decode; BigInteger expectedBigInteger = new BigInteger(bigNumberByteArray); assertEquals(expectedBigInteger, actualBigInteger); }
public abstract Object decode(byte[] encoded, int offset);
SolidityType { public abstract Object decode(byte[] encoded, int offset); }
SolidityType { public abstract Object decode(byte[] encoded, int offset); SolidityType(String name); }
SolidityType { public abstract Object decode(byte[] encoded, int offset); SolidityType(String name); String getName(); @JsonValue String getCanonicalName(); @JsonCreator static SolidityType getType(String typeName); abstract byte[] encode(Object value); abstract Object decode(byte[] encoded, int offset); Object decode(byte[] encoded); int getFixedSize(); boolean isDynamicType(); @Override String toString(); }
SolidityType { public abstract Object decode(byte[] encoded, int offset); SolidityType(String name); String getName(); @JsonValue String getCanonicalName(); @JsonCreator static SolidityType getType(String typeName); abstract byte[] encode(Object value); abstract Object decode(byte[] encoded, int offset); Object decode(byte[] encoded); int getFixedSize(); boolean isDynamicType(); @Override String toString();  }