Skip to content

Commit a57cc4b

Browse files
committed
Fixed #411 transaction status not return
1 parent 5e95c7b commit a57cc4b

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

e2e/infrastructure/Listener.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ describe('Listener', () => {
369369
return helper.announce(transferTransaction.signWith(account, generationHash)).then(() => {
370370
throw new Error('Transaction should have failed!!');
371371
}, (error) => {
372-
expect(error.status).to.be.equal('Failure_Core_Insufficient_Balance');
372+
expect(error.code).to.be.equal('Failure_Core_Insufficient_Balance');
373373
});
374374
});
375375
});

src/infrastructure/Listener.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ export class Listener implements IListener {
160160
extractBeneficiary(message, message.block.network), // passing `message` as `blockDTO`
161161
),
162162
});
163-
} else if (message.status) {
163+
} else if (message.code) {
164164
this.messageSubject.next({
165165
channelName: ListenerChannelName.status, message: new TransactionStatusError(
166166
Address.createFromEncoded(message.address),
167167
message.hash,
168-
message.status,
168+
message.code,
169169
Deadline.createFromDTO(message.deadline)),
170170
});
171171
} else if (message.parentHash) {

src/model/transaction/TransactionStatusError.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class TransactionStatusError {
2626
* @internal
2727
* @param address
2828
* @param hash
29-
* @param status
29+
* @param code
3030
* @param deadline
3131
*/
3232
constructor(
@@ -40,9 +40,9 @@ export class TransactionStatusError {
4040
*/
4141
public readonly hash: string,
4242
/**
43-
* The status error message.
43+
* The error code.
4444
*/
45-
public readonly status: string,
45+
public readonly code: string,
4646
/**
4747
* The transaction deadline.
4848
*/

test/infrastructure/Listener.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('Listener', () => {
5656
address: errorEncodedAddress,
5757
deadline: '1010',
5858
hash: 'transaction-hash',
59-
status: 'error-message',
59+
code: 'error-message',
6060
};
6161

6262
const listener = new Listener('ws://localhost:3000', WebSocketMock);
@@ -75,7 +75,7 @@ describe('Listener', () => {
7575
const transactionStatusError = reportedStatus[0];
7676
expect(transactionStatusError.address).to.deep.equal(errorAddress);
7777
expect(transactionStatusError.hash).to.be.equal(statusInfoErrorDTO.hash);
78-
expect(transactionStatusError.status).to.be.equal(statusInfoErrorDTO.status);
78+
expect(transactionStatusError.code).to.be.equal(statusInfoErrorDTO.code);
7979
deepEqual(transactionStatusError.deadline.toDTO(), UInt64.fromNumericString(statusInfoErrorDTO.deadline).toDTO());
8080

8181
});

test/model/transaction/TransactionStatusError.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ describe('TransactionStatusError', () => {
2828
address: Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'),
2929
deadline: '1010',
3030
hash: 'transaction-hash',
31-
status: 'error-message',
31+
code: 'error-message',
3232
};
3333
const transactionStatusError = new TransactionStatusError(
3434
statusInfoErrorDTO.address,
3535
statusInfoErrorDTO.hash,
36-
statusInfoErrorDTO.status,
36+
statusInfoErrorDTO.code,
3737
Deadline.createFromDTO(statusInfoErrorDTO.deadline));
3838

3939
expect(transactionStatusError.address).to.be.equal(statusInfoErrorDTO.address);
4040
expect(transactionStatusError.hash).to.be.equal(statusInfoErrorDTO.hash);
41-
expect(transactionStatusError.status).to.be.equal(statusInfoErrorDTO.status);
41+
expect(transactionStatusError.code).to.be.equal(statusInfoErrorDTO.code);
4242
deepEqual(transactionStatusError.deadline.toDTO(), UInt64.fromNumericString(statusInfoErrorDTO.deadline).toDTO());
4343
});
4444
});

0 commit comments

Comments
 (0)