Closed hwwhww closed 5 years ago
Basic tests moved to tests/ssz.
Beginning to (1.) write tests for missing types, will update when moved on to (2.) refactoring SSZ to avoid duplicate work in case someone else decides to work on that part while I'm working on (1.). Cheers.
All of my tests have been failing for lists. Has anyone successfully tested the serialization for lists? Maybe I am wrong by assuming [3, 4, 5] --> [b'\x03', b'\x04', b'\x05']
Oh, sorry for that I missed it. The minimum int length is 8, so we have:
serialize([3, 4, 5], ['int8'])
b'\x00\x00\x00\x03\x03\x04\x05'
Ah! That makes a lot more sense. Thanks for the assist!
What's wrong?
Currently, the tests are at tests/utils/test_serialization.py, and it's using
ActiveState
andPartialCrosslinkRecord
classes for testing. It will be nice to use some testing-only Foo classes to cover more testing cases instead of having a dependency ofbeacon_chain
.How can it be fixed
Write new tests at
tests/ssz/test_*.py
. Cover all test cases. Includes: