-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define endorseTimeout value in fabric-sdk-node v1.4(Issue #552) #565
Define endorseTimeout value in fabric-sdk-node v1.4(Issue #552) #565
Conversation
5e84580
to
940a07e
Compare
…#552) In fabric-sdk-node v1.4, as well as in v2.2, define "endorseTimeout" value and use it instead of "commitTimeout". Co-Authored-by: Shinsuke Hasegawa <[email protected]> Signed-off-by: takayuki-nagai <[email protected]>
940a07e
to
29b55d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good. Just a minor test change suggestion.
fabric-network/test/transaction.js
Outdated
await transaction.submit(); | ||
sinon.assert.calledWith(channel.sendTransactionProposal, sinon.match(expectedProposal), 999000); | ||
}); | ||
|
||
it('sends proposal with short timeout', async () => { | ||
stubContract.getEventHandlerOptions.returns({commitTimeout: 3}); | ||
stubContract.getEventHandlerOptions.returns({endorseTimeout: 3}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test seems intended to ensure the specified timeout did not drop below the commitTimeout value. The code no longer behaves this way, and I think your new behaviour is reasonable, so I suggest just removing this test entirely. The behaviour it is testing is already covered by the previous unit test.
fabric-network/test/transaction.js
Outdated
@@ -301,15 +301,15 @@ describe('Transaction', () => { | |||
}); | |||
|
|||
it('sends proposal with long timeout', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new behaviour, this test might be better named.
it('sends proposal with long timeout', async () => { | |
it('uses endorseTimeout option as proposal timeout', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your comment. I'll reflect your advice in the source code.
…#552) In fabric-sdk-node v1.4, as well as in v2.2, define "endorseTimeout" value and use it instead of "commitTimeout". Co-Authored-by: Shinsuke Hasegawa <[email protected]> Signed-off-by: takayuki-nagai <[email protected]>
5a71b85
to
67bc4d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution! 👍
In fabric-sdk-node v1.4, as well as in v2.2, define "endorseTimeout" value and use it instead of commitTimeout.
Co-Authored-by: Shinsuke Hasegawa [email protected]
Signed-off-by: takayuki-nagai [email protected]
Closes #552