Skip to content
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

Merged
merged 2 commits into from
Apr 27, 2022

Conversation

takayuki-nagai
Copy link

@takayuki-nagai takayuki-nagai commented Apr 26, 2022

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

…#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]>
Copy link
Member

@bestbeforetoday bestbeforetoday left a 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.

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});
Copy link
Member

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.

@@ -301,15 +301,15 @@ describe('Transaction', () => {
});

it('sends proposal with long timeout', async () => {
Copy link
Member

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.

Suggested change
it('sends proposal with long timeout', async () => {
it('uses endorseTimeout option as proposal timeout', async () => {

Copy link
Author

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]>
Copy link
Member

@bestbeforetoday bestbeforetoday left a 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! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants