Skip to content

Commit

Permalink
fixup! refactor(rabbitmq): now the package respects all the repositor…
Browse files Browse the repository at this point in the history
…y standards
  • Loading branch information
iccicci committed Jun 20, 2022
1 parent 90728a8 commit 8b785c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/rabbitmq/src/TxSubmitWorker.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-shadow */
import { Cardano, ProviderError, ProviderFailure, TxSubmitProvider } from '@cardano-sdk/core';
import { Channel, Connection, Message, connect } from 'amqplib';
import { Logger, dummyLogger } from 'ts-log';
import { ProviderError, ProviderFailure, TxSubmitProvider } from '@cardano-sdk/core';
import { TX_SUBMISSION_QUEUE, serializeError, txBodyToId, waitForPending } from './utils';

const moduleName = 'TxSubmitWorker';
Expand Down Expand Up @@ -270,7 +270,7 @@ export class TxSubmitWorker {
const txBody = new Uint8Array(content);

// Register the handling of current transaction
txId = txBodyToId(txBody, this.#config.dummyTxId);
txId = this.#config.dummyTxId ? txBodyToId(txBody, true) : Cardano.util.deserializeTx(txBody).id.toString();

this.#dependencies.logger!.info(`${moduleName}: submitting tx #${counter} id: ${txId}`);
this.#dependencies.logger!.debug(`${moduleName}: tx #${counter} dump:`, content.toString('hex'));
Expand Down
5 changes: 4 additions & 1 deletion packages/rabbitmq/src/rabbitmqTxSubmitProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ export class RabbitMqTxSubmitProvider implements TxSubmitProvider {
};

try {
txId = txBodyToId(signedTransaction, this.#config.dummyTxId);
txId = this.#config.dummyTxId
? txBodyToId(signedTransaction, true)
: Cardano.util.deserializeTx(signedTransaction).id.toString();

this.#dependencies.logger!.info(`${moduleName}: queuing tx id: ${txId}`);

// Actually send the message
Expand Down

0 comments on commit 8b785c0

Please sign in to comment.