Skip to content

Commit 8b785c0

Browse files
committed
fixup! refactor(rabbitmq): now the package respects all the repository standards
1 parent 90728a8 commit 8b785c0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/rabbitmq/src/TxSubmitWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-shadow */
2+
import { Cardano, ProviderError, ProviderFailure, TxSubmitProvider } from '@cardano-sdk/core';
23
import { Channel, Connection, Message, connect } from 'amqplib';
34
import { Logger, dummyLogger } from 'ts-log';
4-
import { ProviderError, ProviderFailure, TxSubmitProvider } from '@cardano-sdk/core';
55
import { TX_SUBMISSION_QUEUE, serializeError, txBodyToId, waitForPending } from './utils';
66

77
const moduleName = 'TxSubmitWorker';
@@ -270,7 +270,7 @@ export class TxSubmitWorker {
270270
const txBody = new Uint8Array(content);
271271

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

275275
this.#dependencies.logger!.info(`${moduleName}: submitting tx #${counter} id: ${txId}`);
276276
this.#dependencies.logger!.debug(`${moduleName}: tx #${counter} dump:`, content.toString('hex'));

packages/rabbitmq/src/rabbitmqTxSubmitProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ export class RabbitMqTxSubmitProvider implements TxSubmitProvider {
168168
};
169169

170170
try {
171-
txId = txBodyToId(signedTransaction, this.#config.dummyTxId);
171+
txId = this.#config.dummyTxId
172+
? txBodyToId(signedTransaction, true)
173+
: Cardano.util.deserializeTx(signedTransaction).id.toString();
174+
172175
this.#dependencies.logger!.info(`${moduleName}: queuing tx id: ${txId}`);
173176

174177
// Actually send the message

0 commit comments

Comments
 (0)