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

[Beacon Chain] Undeclared identifier ReaderType #4

Closed
mratsim opened this issue May 9, 2019 · 2 comments
Closed

[Beacon Chain] Undeclared identifier ReaderType #4

mratsim opened this issue May 9, 2019 · 2 comments

Comments

@mratsim
Copy link
Contributor

mratsim commented May 9, 2019

Following our discussion from yesterday I've create a branch that showcase another early symbol resolution issue (nim-lang/Nim#8677)

It is available here: https://github.com/status-im/nim-beacon-chain/tree/serialization_typedesc
The offending proc is: https://github.com/status-im/nim-beacon-chain/blob/8d5ca983/tests/official/fixtures_utils.nim#L113-L126

Running the State tests compile

nim c -r -o:build/test tests/official/test_fixture_state.nim

Note that it will fail at runtime because they do not take into account some changes in 0.6 tests.

But the shuffling tests doesn't

nim c -r -o:build/test tests/official/test_fixture_shuffling.nim

The types are defined here: https://github.com/status-im/nim-beacon-chain/blob/8d5ca983845cfae2628394dbcf7ab8a5b1ce1f75/tests/official/fixtures_utils.nim#L12-L93.

/home/beta/.nimble/pkgs/serialization-0.1.0/serialization.nim(99, 23) Error: undeclared identifier: 'ReaderType'

I tried to use an untyped template as a workaround but it doesn't work.
This is not blocking status-im/nimbus-eth2#263 but I will need to multiply the parseTestFoo proc for the test suite.

Also this might become a blocker for further serialization/deserialization implementations like SOS.

@mratsim

This comment has been minimized.

@zah
Copy link
Contributor

zah commented May 10, 2019

This is a classic instance for what I call the Generics "sandwich problem". I've now documented it here:
nim-lang/Nim#11225

The work-around is to export json_serialization in fixtures_utils

@zah zah closed this as completed May 10, 2019
mratsim added a commit to status-im/nimbus-eth2 that referenced this issue May 16, 2019
mratsim added a commit to status-im/nimbus-eth2 that referenced this issue May 16, 2019
mratsim added a commit to status-im/nimbus-eth2 that referenced this issue May 23, 2019
* Update fixtures with BLS and SSZ generic

* Stash changes following status-im/nim-serialization#4

* Add Private to Public key conversion

* Add message signing tests

* Add aggregate signatures and public keys

* Add BLS to test suite
tersec pushed a commit to status-im/nimbus-eth2 that referenced this issue Jun 17, 2019
* Generics over tests (status-im/nim-serialization#4, status-im/nim-serialization#5, nim-lang/Nim#11225)

* Skeleton of SSZ uint tests

* Check all primitive uint types

* Add deserialization test. "wrong length" skipped due to #280

* Move test types to their specific test files

* Stint also sometimes throws an AssertionError for invalid ranges

* Add debug path for Access denied issue in Appveyor 64-bit (https://ci.appveyor.com/project/nimbus/nim-beacon-chain/builds/25278666/job/fs8q0bcluvj2gdor#L866)

* indent the Appveyor debug info
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

2 participants