@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; } }
@Test public void testEthGetTransactionByBlockHashAndIndex() throws Exception { BigInteger index = BigInteger.ONE; EthTransaction ethTransaction = web3j.ethGetTransactionByBlockHashAndIndex( config.validBlockHash(), index).send(); assertTrue(ethTransaction.getTransaction().isPresent()); Transaction transaction = ethTransaction.getTransaction().get(); assertThat(transaction.getBlockHash(), is(config.validBlockHash())); assertThat(transaction.getTransactionIndex(), equalTo(index)); }
@Test public void testEthGetTransactionByHash() throws Exception { EthTransaction ethTransaction = web3j.ethGetTransactionByHash( config.validTransactionHash()).send(); assertTrue(ethTransaction.getTransaction().isPresent()); Transaction transaction = ethTransaction.getTransaction().get(); assertThat(transaction.getBlockHash(), is(config.validBlockHash())); }
@Test public void testEthGetTransactionByBlockNumberAndIndex() throws Exception { BigInteger index = BigInteger.ONE; EthTransaction ethTransaction = web3j.ethGetTransactionByBlockNumberAndIndex( DefaultBlockParameter.valueOf(config.validBlock()), index).send(); assertTrue(ethTransaction.getTransaction().isPresent()); Transaction transaction = ethTransaction.getTransaction().get(); assertThat(transaction.getBlockHash(), is(config.validBlockHash())); assertThat(transaction.getTransactionIndex(), equalTo(index)); }
return false; if (getBlockHash() != null ? !getBlockHash().equals(that.getBlockHash()) : that.getBlockHash() != null) { return false;