@Override public int hashCode() { int result = getTransactionHash() != null ? getTransactionHash().hashCode() : 0; result = 31 * result + (transactionIndex != null ? transactionIndex.hashCode() : 0); result = 31 * result + (getBlockHash() != null ? getBlockHash().hashCode() : 0); result = 31 * result + (blockNumber != null ? blockNumber.hashCode() : 0); result = 31 * result + (cumulativeGasUsed != null ? cumulativeGasUsed.hashCode() : 0); result = 31 * result + (gasUsed != null ? gasUsed.hashCode() : 0); result = 31 * result + (getContractAddress() != null ? getContractAddress().hashCode() : 0); result = 31 * result + (getRoot() != null ? getRoot().hashCode() : 0); result = 31 * result + (getStatus() != null ? getStatus().hashCode() : 0); result = 31 * result + (getFrom() != null ? getFrom().hashCode() : 0); result = 31 * result + (getTo() != null ? getTo().hashCode() : 0); result = 31 * result + (getLogs() != null ? getLogs().hashCode() : 0); result = 31 * result + (getLogsBloom() != null ? getLogsBloom().hashCode() : 0); return result; }
public static Transaction fromEthGetTransactionReceipt( EthGetTransactionReceipt ethGetTransactionReceipt) { TransactionReceipt transactionReceipt = ethGetTransactionReceipt.getTransactionReceipt(); String hash = transactionReceipt.getTransactionHash(); String from = transactionReceipt.getFrom(); Log log = transactionReceipt.getLogs() .get(0); String to = log.getAddress(); String value = extractValueFromEthGetTransactionReceipt(log.getData()); Status status = parseStatus(transactionReceipt.getStatus()); String contractAddress = ethGetTransactionReceipt.getTransactionReceipt() .getTo(); return new Transaction(hash, from, to, value, status); }
assertThat(transactionReceipt.getFrom()).isEqualTo(senderAddress);