Skip to content

Commit cf0df9b

Browse files
authored
Merge pull request #413 from NEMStudios/task/g411_listener_status
Fixed listener status bug and make MultisigAccountGraphInfo constructor public
2 parents 369acd0 + 66d470d commit cf0df9b

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

e2e/infrastructure/BlockHttp.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('BlockHttp', () => {
8080
const signedTransaction = transferTransaction.signWith(account, generationHash);
8181
helper.announce(signedTransaction).then((transaction) => {
8282
chainHeight = transaction.transactionInfo!.height.toString();
83-
return transaction;
83+
done();
8484
});
8585
});
8686
});

e2e/infrastructure/IntegrationTestHelper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export class IntegrationTestHelper {
7777
'../../../catapult-service-bootstrap/build/generated-addresses/addresses.yaml'),
7878
(error: any, yamlData: any) => {
7979
if (error) {
80-
console.log(`catapult-service-bootstrap generated address could not be loaded.
81-
Ignoring and using accounts from network.conf. Error: ${error}`);
80+
console.log(`catapult-service-bootstrap generated address could not be loaded. Ignoring and using accounts from network.conf.`);
8281
return resolve(this);
8382
} else {
8483
const parsedYaml = this.yaml.safeLoad(yamlData);

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/account/MultisigAccountGraphInfo.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {MultisigAccountInfo} from './MultisigAccountInfo';
2222
export class MultisigAccountGraphInfo {
2323

2424
/**
25-
* @internal
2625
* @param multisigAccounts
2726
*/
2827
constructor(/**

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)