@Override public int hashCode() { int result = getHash() != null ? getHash().hashCode() : 0; result = 31 * result + (getNonceRaw() != null ? getNonceRaw().hashCode() : 0); result = 31 * result + (getBlockHash() != null ? getBlockHash().hashCode() : 0); result = 31 * result + (getBlockNumberRaw() != null ? getBlockNumberRaw().hashCode() : 0); result = 31 * result + (getTransactionIndexRaw() != null ? getTransactionIndexRaw().hashCode() : 0); result = 31 * result + (getFrom() != null ? getFrom().hashCode() : 0); result = 31 * result + (getTo() != null ? getTo().hashCode() : 0); result = 31 * result + (getValueRaw() != null ? getValueRaw().hashCode() : 0); result = 31 * result + (getGasPriceRaw() != null ? getGasPriceRaw().hashCode() : 0); result = 31 * result + (getGasRaw() != null ? getGasRaw().hashCode() : 0); result = 31 * result + (getInput() != null ? getInput().hashCode() : 0); result = 31 * result + (getCreates() != null ? getCreates().hashCode() : 0); result = 31 * result + (getPublicKey() != null ? getPublicKey().hashCode() : 0); result = 31 * result + (getRaw() != null ? getRaw().hashCode() : 0); result = 31 * result + (getR() != null ? getR().hashCode() : 0); result = 31 * result + (getS() != null ? getS().hashCode() : 0); result = 31 * result + BigInteger.valueOf(getV()).hashCode(); return result; } }
public static Transaction fromEthTransaction(EthTransaction ethTransaction, Status status) { org.web3j.protocol.core.methods.response.Transaction transaction = ethTransaction.getTransaction(); String hash = transaction.getHash(); String from = transaction.getFrom(); String input = ethTransaction.getTransaction() .getInput(); String to = extractToFromEthTransaction(input); String value = extractValueFromEthTransaction(input); String contractAddress = ethTransaction.getTransaction() .getTo(); return new Transaction(hash, from, to, value, status); }