Skip to content

Commit

Permalink
rename zmq tx_trytes to trytes (iotaledger#1772)
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill authored and Brord van Wierst committed Mar 10, 2020
1 parent 9d96998 commit 34c6831
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/iota/iri/zmq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Topics currently found in the latest code are
* `sn` for newly confirmed transactions ( by solid milestone children measurement )
* `sn_trytes` for raw trytes, transaction hash, and snapshot index of confirmed transactions.
* `tx` for newly seen transactions
* `tx_trytes` trytes of newly seen transactions
* `trytes` trytes of newly seen transactions
* `<Address>` to watch activity on an address

All topic must be lowercase (to not clash with `<Address>` containing the topic title - like `TXCR9...` & `TX`)
18 changes: 9 additions & 9 deletions src/main/java/com/iota/iri/zmq/ZmqMessageQueueProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public boolean publishTransaction(Persistable model, Indexable index, String ite
TransactionViewModel transactionViewModel = new TransactionViewModel(transaction, (Hash)index);

publishTx(transactionViewModel);
publishTxTrytes(transactionViewModel);
publishTrytes(transactionViewModel);

return true;
}
Expand Down Expand Up @@ -70,18 +70,18 @@ private void publishTx(TransactionViewModel transactionViewModel) {
}
}

private void publishTxTrytes(TransactionViewModel transactionViewModel) {
StringBuilder txTrytesStringBuilder = new StringBuilder(TransactionViewModel.TRINARY_SIZE/3);
private void publishTrytes(TransactionViewModel transactionViewModel) {
StringBuilder trytesStringBuilder = new StringBuilder(TransactionViewModel.TRINARY_SIZE/3);

try {
txTrytesStringBuilder.append("tx_trytes ");
txTrytesStringBuilder.append(Converter.trytes(transactionViewModel.trits())); txTrytesStringBuilder.append(" ");
txTrytesStringBuilder.append(transactionViewModel.getHash());
trytesStringBuilder.append("trytes ");
trytesStringBuilder.append(Converter.trytes(transactionViewModel.trits())); trytesStringBuilder.append(" ");
trytesStringBuilder.append(transactionViewModel.getHash());

messageQ.publish(txTrytesStringBuilder.toString());
messageQ.publish(trytesStringBuilder.toString());
} catch (Exception e) {
log.error(txTrytesStringBuilder.toString());
log.error("Error publishing tx_trytes to zmq.", e);
log.error(trytesStringBuilder.toString());
log.error("Error publishing trytes to zmq.", e);
}
}

Expand Down

0 comments on commit 34c6831

Please sign in to comment.