Commit cc0a62e
authored
feat: add
* Initial `eth2wrap` module
* Add initial `version`
* Add tests
* Merge remote-tracking branch 'origin/main' into emlautarom1/eth2wrap
* Use `SemVer::parse` instead of `SemVer::try_from` for version parsing
* Replace function with static HashMap
- Avoids parsing on each request
* Fix clippy lint errors
* Add `RUSTC_BOOTSTRAP`
- Prevents VSCode from rebuilding everything during tests
* Prefer `&str` for `TryFrom`
- Makes it easier to use `String` and `str` at the same time
* Add `eth2api` and `anyhow` as deps
* Add `valcache` as module
* Add `eth2api` extensions module
- Redices boilerplate when dealing with the `eth2api` lib
- Use `eth2api` types in `valcache`
* Implement `get_by_head`
* Add `get_by_slot`
* Extract common mapping code
* Reduce the scope of locks
* Apply suggestions
- Remove redundant code
- Use `From` for `PoisonError`
- Code cleanup
* Update docs
* Use raw Validator type
- Prefer `GetStateValidatorsResponseResponseDatum` over custom `Validator`
* Apply clippy suggestions
* Update docs
- Make them closer to the original implementation
* Update lockfile
* Include `Serialize` for all types
- Useful for mocking requests/responses in tests
* Initial test for `valcache`
* Add test for failing request
- Use `POST` endpoint since reqwest cannot deal with complex query params
- Use `wiremock` to fake an HTTP server
* Test cache population
* Test for cache population
- Beacon should be called once
* Port `validator_cache` test
* Remove tests
- Superseded by Go tests
* Add `get_by_slot_successful_fetch`
* Refactor
- Extract common code
- Rename tests
- Inline methods
* Add `get_by_slot_fallback_to_head`
* Update lockfile
* Apply Slippy suggestions
* Apply Copilot suggestions
* Use tokio mutex
- Hold lock across awaits
- Match the original Go implementation
- Simplify internals
* Use `tokio::sync::RwLock` instead
* Merge remote-tracking branch 'origin/main' into emlautarom1/eth2wrap/valcacheeth2wrap/valcache (#122)1 parent 4b6aa1f commit cc0a62e
9 files changed
Lines changed: 690 additions & 9 deletions
File tree
- crates
- charon-core/src
- charon
- src/eth2wrap
- eth2api
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
| 226 | + | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
907 | | - | |
| 907 | + | |
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
38 | 42 | | |
39 | 43 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments