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

INDY-2324: Improvements in SimNetwork #1459

Merged
merged 3 commits into from
Jan 20, 2020

Conversation

skhoroshavin
Copy link
Member

No description provided.

Sergey Khoroshavin added 2 commits January 16, 2020 21:08
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
return _selector


class ProcessingChain:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to have unit tests for this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fully agree, however part of this was already indirectly tested through legacy interface

if not all(selector(msg, frm, dst) for selector in p.selectors):
continue

if isinstance(p.action, Discard):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may make sense to follow chain-of-responsibility pattern more formally (have a Handler interface so that every processor implements it) to avoid isinstance checks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that having isinstance checks is often an anti-pattern, however implementing full chain-of-responsibility looked like an overkill for this simple use case.

@ashcherbakov ashcherbakov merged commit 9826488 into hyperledger:master Jan 20, 2020
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.

None yet

2 participants