From a57cc4b1dbb90f41c3b996d3bbbfeadf03d70ec1 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Mon, 6 Jan 2020 09:58:02 +0000 Subject: [PATCH 1/3] Fixed #411 transaction status not return --- e2e/infrastructure/Listener.spec.ts | 2 +- src/infrastructure/Listener.ts | 4 ++-- src/model/transaction/TransactionStatusError.ts | 6 +++--- test/infrastructure/Listener.spec.ts | 4 ++-- test/model/transaction/TransactionStatusError.spec.ts | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/e2e/infrastructure/Listener.spec.ts b/e2e/infrastructure/Listener.spec.ts index 5114b35817..7275251fb1 100644 --- a/e2e/infrastructure/Listener.spec.ts +++ b/e2e/infrastructure/Listener.spec.ts @@ -369,7 +369,7 @@ describe('Listener', () => { return helper.announce(transferTransaction.signWith(account, generationHash)).then(() => { throw new Error('Transaction should have failed!!'); }, (error) => { - expect(error.status).to.be.equal('Failure_Core_Insufficient_Balance'); + expect(error.code).to.be.equal('Failure_Core_Insufficient_Balance'); }); }); }); diff --git a/src/infrastructure/Listener.ts b/src/infrastructure/Listener.ts index 09a368969e..01867ff680 100644 --- a/src/infrastructure/Listener.ts +++ b/src/infrastructure/Listener.ts @@ -160,12 +160,12 @@ export class Listener implements IListener { extractBeneficiary(message, message.block.network), // passing `message` as `blockDTO` ), }); - } else if (message.status) { + } else if (message.code) { this.messageSubject.next({ channelName: ListenerChannelName.status, message: new TransactionStatusError( Address.createFromEncoded(message.address), message.hash, - message.status, + message.code, Deadline.createFromDTO(message.deadline)), }); } else if (message.parentHash) { diff --git a/src/model/transaction/TransactionStatusError.ts b/src/model/transaction/TransactionStatusError.ts index 313695bd4f..01cb7d9c97 100644 --- a/src/model/transaction/TransactionStatusError.ts +++ b/src/model/transaction/TransactionStatusError.ts @@ -26,7 +26,7 @@ export class TransactionStatusError { * @internal * @param address * @param hash - * @param status + * @param code * @param deadline */ constructor( @@ -40,9 +40,9 @@ export class TransactionStatusError { */ public readonly hash: string, /** - * The status error message. + * The error code. */ - public readonly status: string, + public readonly code: string, /** * The transaction deadline. */ diff --git a/test/infrastructure/Listener.spec.ts b/test/infrastructure/Listener.spec.ts index 0d0ba57b08..71dfbf46cd 100644 --- a/test/infrastructure/Listener.spec.ts +++ b/test/infrastructure/Listener.spec.ts @@ -56,7 +56,7 @@ describe('Listener', () => { address: errorEncodedAddress, deadline: '1010', hash: 'transaction-hash', - status: 'error-message', + code: 'error-message', }; const listener = new Listener('ws://localhost:3000', WebSocketMock); @@ -75,7 +75,7 @@ describe('Listener', () => { const transactionStatusError = reportedStatus[0]; expect(transactionStatusError.address).to.deep.equal(errorAddress); expect(transactionStatusError.hash).to.be.equal(statusInfoErrorDTO.hash); - expect(transactionStatusError.status).to.be.equal(statusInfoErrorDTO.status); + expect(transactionStatusError.code).to.be.equal(statusInfoErrorDTO.code); deepEqual(transactionStatusError.deadline.toDTO(), UInt64.fromNumericString(statusInfoErrorDTO.deadline).toDTO()); }); diff --git a/test/model/transaction/TransactionStatusError.spec.ts b/test/model/transaction/TransactionStatusError.spec.ts index b7fcc61867..1d8ef285f9 100644 --- a/test/model/transaction/TransactionStatusError.spec.ts +++ b/test/model/transaction/TransactionStatusError.spec.ts @@ -28,17 +28,17 @@ describe('TransactionStatusError', () => { address: Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'), deadline: '1010', hash: 'transaction-hash', - status: 'error-message', + code: 'error-message', }; const transactionStatusError = new TransactionStatusError( statusInfoErrorDTO.address, statusInfoErrorDTO.hash, - statusInfoErrorDTO.status, + statusInfoErrorDTO.code, Deadline.createFromDTO(statusInfoErrorDTO.deadline)); expect(transactionStatusError.address).to.be.equal(statusInfoErrorDTO.address); expect(transactionStatusError.hash).to.be.equal(statusInfoErrorDTO.hash); - expect(transactionStatusError.status).to.be.equal(statusInfoErrorDTO.status); + expect(transactionStatusError.code).to.be.equal(statusInfoErrorDTO.code); deepEqual(transactionStatusError.deadline.toDTO(), UInt64.fromNumericString(statusInfoErrorDTO.deadline).toDTO()); }); }); From 43fe7785f8545385cc6892c599def5b0b3c148fe Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Mon, 6 Jan 2020 10:05:34 +0000 Subject: [PATCH 2/3] Fixed blockHttp integration test bug --- e2e/infrastructure/BlockHttp.spec.ts | 2 +- e2e/infrastructure/IntegrationTestHelper.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/e2e/infrastructure/BlockHttp.spec.ts b/e2e/infrastructure/BlockHttp.spec.ts index 73356ba2a7..f87504ef83 100644 --- a/e2e/infrastructure/BlockHttp.spec.ts +++ b/e2e/infrastructure/BlockHttp.spec.ts @@ -80,7 +80,7 @@ describe('BlockHttp', () => { const signedTransaction = transferTransaction.signWith(account, generationHash); helper.announce(signedTransaction).then((transaction) => { chainHeight = transaction.transactionInfo!.height.toString(); - return transaction; + done(); }); }); }); diff --git a/e2e/infrastructure/IntegrationTestHelper.ts b/e2e/infrastructure/IntegrationTestHelper.ts index 2e158f3bd4..a8dba96d4d 100644 --- a/e2e/infrastructure/IntegrationTestHelper.ts +++ b/e2e/infrastructure/IntegrationTestHelper.ts @@ -77,8 +77,7 @@ export class IntegrationTestHelper { '../../../catapult-service-bootstrap/build/generated-addresses/addresses.yaml'), (error: any, yamlData: any) => { if (error) { - console.log(`catapult-service-bootstrap generated address could not be loaded. - Ignoring and using accounts from network.conf. Error: ${error}`); + console.log(`catapult-service-bootstrap generated address could not be loaded. Ignoring and using accounts from network.conf.`); return resolve(this); } else { const parsedYaml = this.yaml.safeLoad(yamlData); From 2523013575d83b0cd8b50549c2fcda3dbdb1ed11 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Mon, 6 Jan 2020 10:09:58 +0000 Subject: [PATCH 3/3] Fixed #410 removed internal from MultisigAccountGraphInfo --- src/model/account/MultisigAccountGraphInfo.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/model/account/MultisigAccountGraphInfo.ts b/src/model/account/MultisigAccountGraphInfo.ts index 0b80534f14..548eab9cd6 100644 --- a/src/model/account/MultisigAccountGraphInfo.ts +++ b/src/model/account/MultisigAccountGraphInfo.ts @@ -22,7 +22,6 @@ import {MultisigAccountInfo} from './MultisigAccountInfo'; export class MultisigAccountGraphInfo { /** - * @internal * @param multisigAccounts */ constructor(/**