本文整理了Java中org.web3j.utils.Numeric.decodeQuantity()
方法的一些代码示例,展示了Numeric.decodeQuantity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Numeric.decodeQuantity()
方法的具体详情如下:
包路径:org.web3j.utils.Numeric
类名称:Numeric
方法名:decodeQuantity
暂无
代码示例来源:origin: web3j/web3j
private BigInteger convert(String value) {
if (value != null) {
return Numeric.decodeQuantity(value);
} else {
return null;
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getSent() {
return Numeric.decodeQuantity(sent);
}
代码示例来源:origin: web3j/web3j
public BigInteger getBlockNumber() {
return Numeric.decodeQuantity(blockNumber);
}
代码示例来源:origin: web3j/web3j
public BigInteger getGasUsed() {
return Numeric.decodeQuantity(gasUsed);
}
代码示例来源:origin: web3j/web3j
public BigInteger getGasUsed() {
return Numeric.decodeQuantity(gasUsed);
}
代码示例来源:origin: web3j/web3j
public boolean isStatusOK() {
if (null == status) {
return true;
}
BigInteger statusQuantity = Numeric.decodeQuantity(status);
return BigInteger.ONE.equals(statusQuantity);
}
代码示例来源:origin: web3j/web3j
public BigInteger getTransactionCount() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getTransactionCount() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getQuantity() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getUncleCount() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getGasPrice() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getUncleCount() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getAmountUsed() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getFilterId() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getBlockNumber() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
public BigInteger getFilterId() {
return Numeric.decodeQuantity(getResult());
}
}
代码示例来源:origin: web3j/web3j
@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")));
}
代码示例来源:origin: web3j/web3j
@Test
public void testQuantityDecodeLeadingZero() {
assertThat(Numeric.decodeQuantity("0x0400"), equalTo(BigInteger.valueOf(1024L)));
assertThat(Numeric.decodeQuantity("0x001"), equalTo(BigInteger.valueOf(1L)));
}
代码示例来源:origin: web3j/web3j
@Test(expected = MessageDecodingException.class)
public void testQuantityDecodeMissingPrefix() {
Numeric.decodeQuantity("ff");
}
代码示例来源:origin: web3j/web3j
@Ignore
@Test(expected = MessageDecodingException.class)
public void testQuantityDecodeLeadingZeroException() {
Numeric.decodeQuantity("0x0400");
}
内容来源于网络,如有侵权,请联系作者删除!