/** * Utility method to provide the transaction hash for a given transaction. * * @param rawTransaction we wish to send * @param chainId of the intended chain * @param credentials of the sender * @return transaction hash as a hex encoded string */ public static String generateTransactionHashHexEncoded( RawTransaction rawTransaction, byte chainId, Credentials credentials) { return Numeric.toHexString(generateTransactionHash(rawTransaction, chainId, credentials)); } }
@Test public void testGenerateTransactionHash() { assertThat(generateTransactionHashHexEncoded( TransactionEncoderTest.createContractTransaction(), SampleKeys.CREDENTIALS), is("0xc3a0f520404c8cd0cb1c98be6b8e17ee32bf134ac1697d078e90422525c2d902")); }
@Test public void testGenerateEip155TransactionHash() { assertThat(generateTransactionHashHexEncoded( TransactionEncoderTest.createContractTransaction(), (byte) 1, SampleKeys.CREDENTIALS), is("0x568c7f6920c1cee8332e245c473657b9c53044eb96ed7532f5550f1139861e9e")); } }
/** * Utility method to provide the transaction hash for a given transaction. * * @param rawTransaction we wish to send * @param credentials of the sender * @return transaction hash as a hex encoded string */ public static String generateTransactionHashHexEncoded( RawTransaction rawTransaction, Credentials credentials) { return Numeric.toHexString(generateTransactionHash(rawTransaction, credentials)); }
/** * Utility method to provide the transaction hash for a given transaction. * * @param rawTransaction we wish to send * @param credentials of the sender * @return transaction hash as a hex encoded string */ public static String generateTransactionHashHexEncoded( RawTransaction rawTransaction, Credentials credentials) { return Numeric.toHexString(generateTransactionHash(rawTransaction, credentials)); }
/** * Utility method to provide the transaction hash for a given transaction. * * @param rawTransaction we wish to send * @param chainId of the intended chain * @param credentials of the sender * @return transaction hash as a hex encoded string */ public static String generateTransactionHashHexEncoded( RawTransaction rawTransaction, byte chainId, Credentials credentials) { return Numeric.toHexString(generateTransactionHash(rawTransaction, chainId, credentials)); } }