Solve error at block 0 on syncing status
Resolves #383
Description
When the node starts to run for the first time when called the method starknet_syncing, it will try to ask for block information that isn't yet on the database, so, it will return nil.
With this approach, we are returning 0 in case of those blocks are not found yet on the database.
Changes:
- Catch edge case on
starknet_syncingat block 0 - Refactor struct of SyncingStatus on RPC
Types of changes
- Bugfix (non-breaking change which fixes an issue)
Testing
Requires testing: Yes
Did you write tests??: No
Documentation
If this requires a documentation update, did you add one? No
Codecov Report
Merging #392 (0f4b353) into main (4b200cd) will decrease coverage by
0.02%. The diff coverage is90.32%.
@@ Coverage Diff @@
## main #392 +/- ##
==========================================
- Coverage 93.15% 93.13% -0.03%
==========================================
Files 67 67
Lines 7192 7208 +16
==========================================
+ Hits 6700 6713 +13
- Misses 486 488 +2
- Partials 6 7 +1
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 93.13% <90.32%> (-0.03%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| internal/rpc/starknet/starknet.go | 0.00% <ø> (ø) |
|
| internal/rpc/starknet/types.go | 24.08% <75.00%> (+2.12%) |
:arrow_up: |
| internal/sync/sync.go | 100.00% <100.00%> (ø) |
|
| pkg/felt/felt.go | 100.00% <0.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.