Java Code Examples for org.fisco.bcos.web3j.utils.Numeric#decodeQuantity()

The following examples show how to use org.fisco.bcos.web3j.utils.Numeric#decodeQuantity() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Log.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
private BigInteger convert(String value) {
    if (value != null) {
        return Numeric.decodeQuantity(value);
    } else {
        return null;
    }
}
 
Example 2
Source File: TransactionReceipt.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
@JsonIgnore
public boolean isStatusOK() {
    if (null == status) {
        return true;
    }

    try {
        BigInteger statusQuantity = Numeric.decodeQuantity(status);
        return BigInteger.ZERO.equals(statusQuantity);
    } catch (Exception e) {
        return false;
    }
}
 
Example 3
Source File: RevertResolver.java    From web3sdk with Apache License 2.0 5 votes vote down vote up
/**
 * @param status
 * @param output
 * @return
 */
public static boolean hasRevertMessage(String status, String output) {
    if (Strings.isEmpty(status) || Strings.isEmpty(output)) {
        return false;
    }
    try {
        BigInteger statusQuantity = Numeric.decodeQuantity(status);
        return !BigInteger.ZERO.equals(statusQuantity) && isOutputStartWithRevertMethod(output);
    } catch (Exception e) {
        return false;
    }
}
 
Example 4
Source File: BcosBlock.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getGasLimit() {
    return Numeric.decodeQuantity(gasLimit);
}
 
Example 5
Source File: BlockNumber.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getBlockNumber() {
    return Numeric.decodeQuantity(getResult());
}
 
Example 6
Source File: PendingTxSize.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getPendingTxSize() {
    return Numeric.decodeQuantity(getResult());
}
 
Example 7
Source File: BcosFilter.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getFilterId() {
    return Numeric.decodeQuantity(getResult());
}
 
Example 8
Source File: TransactionReceipt.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getGasUsed() {
    return Numeric.decodeQuantity(gasUsed);
}
 
Example 9
Source File: TransactionReceipt.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getBlockNumber() {
    return Numeric.decodeQuantity(blockNumber);
}
 
Example 10
Source File: TransactionReceipt.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getTransactionIndex() {
    return Numeric.decodeQuantity(transactionIndex);
}
 
Example 11
Source File: BcosBlock.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getTimestamp() {
    return Numeric.decodeQuantity(timestamp);
}
 
Example 12
Source File: BcosBlock.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getGasUsed() {
    return Numeric.decodeQuantity(gasUsed);
}
 
Example 13
Source File: BcosBlock.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getNonce() {
    if (nonce == null) return new BigInteger("0");
    return Numeric.decodeQuantity(nonce);
}
 
Example 14
Source File: BcosBlock.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getNumber() {
    return Numeric.decodeQuantity(number);
}
 
Example 15
Source File: PbftView.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getPbftView() {
    return Numeric.decodeQuantity(getResult());
}
 
Example 16
Source File: Transaction.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getGas() {
    return Numeric.decodeQuantity(gas);
}
 
Example 17
Source File: TotalTransactionCount.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getTxSum() {
    return Numeric.decodeQuantity(txSum);
}
 
Example 18
Source File: Transaction.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getValue() {
    return Numeric.decodeQuantity(value);
}
 
Example 19
Source File: Transaction.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getTransactionIndex() {
    return Numeric.decodeQuantity(transactionIndex);
}
 
Example 20
Source File: Transaction.java    From web3sdk with Apache License 2.0 4 votes vote down vote up
public BigInteger getNonce() {
    return Numeric.decodeQuantity(nonce);
}