Skip to content

Commit

Permalink
Merge pull request #2248 from ethereum/issue/2246
Browse files Browse the repository at this point in the history
Response handling of GetTransactionReceiptMethod fixed and test updated
  • Loading branch information
nivida authored Jan 28, 2019
2 parents af15afa + 1052f10 commit b9b9304
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ export default class GetTransactionReceiptMethod extends AbstractCallMethod {
*
* @method afterExecution
*
* @param {Object} response
* @param {Object|null} response
*
* @returns {Object}
* @returns {Object|null}
*/
afterExecution(response) {
return this.formatters.outputTransactionFormatter(response);
if (response !== null) {
return this.formatters.outputTransactionFormatter(response);
}

return response;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ describe('GetTransactionReceiptMethodTest', () => {

expect(formatters.outputTransactionFormatter).toHaveBeenCalledWith({});
});

it('afterExecution should return null', () => {
expect(method.afterExecution(null)).toEqual(null);
});
});

0 comments on commit b9b9304

Please sign in to comment.