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

Cross-client test vectors for ContentKeys #197

Closed
oslfmt opened this issue Dec 10, 2021 · 3 comments
Closed

Cross-client test vectors for ContentKeys #197

oslfmt opened this issue Dec 10, 2021 · 3 comments

Comments

@oslfmt
Copy link
Contributor

oslfmt commented Dec 10, 2021

Create test vectors for encoding & decoding ContentKeys (like here) following #108.

@oslfmt
Copy link
Contributor Author

oslfmt commented Dec 14, 2021

@njgheorghita Looking at the test vectors that were implemented for portal wire protocol messages, I see that the only difference between my current unit tests are that the vectors explicitly test encoding, expecting that a given input matches to a specific hex string. I don't do this currently, I only encode, then immediately decode, and check to see if the decoded key matches the original. So is the task at hand here then to 1) create a test vector spec, specifying inputs/outputs for each encoding/decoding of each content key, and then 2) tweaking my unit tests to explicitly test encoding?

I was under the impression that I had to create some completely new tests, but it seems "test vector" and "unit test" are somewhat synonymous?

Also, on the topic of explicitly testing encoding, is the reason that is necessary is because the encoding may be incorrect, but somehow the decoding is, and so we miss that error if we don't check for it? Sorry for many questions, just trying to understand the rationale behind what I'm doing

@oslfmt
Copy link
Contributor Author

oslfmt commented Dec 15, 2021

This is now being solved here: ethereum/portal-network-specs#123

@oslfmt
Copy link
Contributor Author

oslfmt commented Jan 22, 2022

Fixed with #229

@oslfmt oslfmt closed this as completed Jan 22, 2022
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

No branches or pull requests

1 participant