File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
client/src/main/java/jp/co/soramitsu/iroha/java Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,42 @@ public static String toHex(byte[] b) {
233233 return DatatypeConverter .printHexBinary (b );
234234 }
235235
236+ /**
237+ * Get transaction hash hexstring
238+ * @param transaction
239+ * @return lowercase hexstring
240+ */
241+ public String toHexHash (TransactionOuterClass .Transaction transaction ) {
242+ return DatatypeConverter .printHexBinary (hash (transaction )).toLowerCase ();
243+ }
244+
245+ /**
246+ * Get query hash hexstring
247+ * @param query
248+ * @return lowercase hexstring
249+ */
250+ public String toHexHash (Queries .Query query ) {
251+ return DatatypeConverter .printHexBinary (hash (query )).toLowerCase ();
252+ }
253+
254+ /**
255+ * Get block_v1 hash hexstring
256+ * @param block_v1
257+ * @return lowercase hexstring
258+ */
259+ public String toHexHash (Block_v1 block_v1 ) {
260+ return DatatypeConverter .printHexBinary (hash (block_v1 )).toLowerCase ();
261+ }
262+
263+ /**
264+ * Get block hash hexstring
265+ * @param block
266+ * @return lowercase hexstring
267+ */
268+ public String toHexHash (Block block ) {
269+ return DatatypeConverter .printHexBinary (hash (block )).toLowerCase ();
270+ }
271+
236272 public static Iterable <String > getProtoBatchHashesHex (
237273 Iterable <TransactionOuterClass .Transaction > list ) {
238274 return StreamSupport .stream (list .spliterator (), false )
You can’t perform that action at this time.
0 commit comments