private BigInteger convert(String value) { if (value != null) { return Numeric.decodeQuantity(value); } else { return null; } }
public BigInteger getSent() { return Numeric.decodeQuantity(sent); }
public BigInteger getBlockNumber() { return Numeric.decodeQuantity(blockNumber); }
public BigInteger getGasUsed() { return Numeric.decodeQuantity(gasUsed); }
public BigInteger getGasUsed() { return Numeric.decodeQuantity(gasUsed); }
public boolean isStatusOK() { if (null == status) { return true; } BigInteger statusQuantity = Numeric.decodeQuantity(status); return BigInteger.ONE.equals(statusQuantity); }
public BigInteger getTransactionCount() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getTransactionCount() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getQuantity() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getUncleCount() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getGasPrice() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getUncleCount() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getAmountUsed() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getFilterId() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getBlockNumber() { return Numeric.decodeQuantity(getResult()); } }
public BigInteger getFilterId() { return Numeric.decodeQuantity(getResult()); } }
@Test public void testQuantityDecode() { assertThat(Numeric.decodeQuantity("0x0"), equalTo(BigInteger.valueOf(0L))); assertThat(Numeric.decodeQuantity("0x400"), equalTo(BigInteger.valueOf((1024L)))); assertThat(Numeric.decodeQuantity("0x0"), equalTo(BigInteger.valueOf((0L)))); assertThat(Numeric.decodeQuantity( "0x7fffffffffffffff"), equalTo(BigInteger.valueOf((Long.MAX_VALUE)))); assertThat(Numeric.decodeQuantity("0x99dc848b94efc27edfad28def049810f"), equalTo(new BigInteger("204516877000845695339750056077105398031"))); }
@Test public void testQuantityDecodeLeadingZero() { assertThat(Numeric.decodeQuantity("0x0400"), equalTo(BigInteger.valueOf(1024L))); assertThat(Numeric.decodeQuantity("0x001"), equalTo(BigInteger.valueOf(1L))); }
@Test(expected = MessageDecodingException.class) public void testQuantityDecodeMissingPrefix() { Numeric.decodeQuantity("ff"); }
@Ignore @Test(expected = MessageDecodingException.class) public void testQuantityDecodeLeadingZeroException() { Numeric.decodeQuantity("0x0400"); }