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

Fix validation logic #99

Merged
merged 25 commits into from
Oct 23, 2020
Merged

Fix validation logic #99

merged 25 commits into from
Oct 23, 2020

Conversation

atonks2
Copy link
Contributor

@atonks2 atonks2 commented Oct 22, 2020

These changes were made as a result of reviewing fedWireMessage side by side with the FedWire Format Reference Guide. They aim to accomplish two things:

  1. Correct discrepancies between fedWireMessage.go and the spec referenced above
  2. Document the requirements for each tag above its validation function

I think two followup tasks would be beneficial:

  1. fedWireMessage handles validation of message tags with relation to the other tags, but relies on each tag's Validate() method to verify data integrity within that tag. We should conduct a review of each tag's Validate method to ensure it's in line with the spec.
  2. The existing unit tests cover a lot of good cases, but we should make sure we have 100% coverage where compliance with the spec is concerned.
    • Related to this, nearly every unit test I encountered has its assertion(s) wrapped in conditional statements. These unit tests expect an error to be returned, then they assert that the actual error matches the expected error. The issue with this is if the system under test doesn't return an error, the test still passes even though it should fail.

Copy link
Member

@adamdecaf adamdecaf left a comment

Choose a reason for hiding this comment

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

This is some awesome work, thanks so much!

@atonks2 atonks2 merged commit 65b0e62 into master Oct 23, 2020
@atonks2 atonks2 deleted the fix-validation-logic branch October 23, 2020 16:42
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