Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

feat: update some logic and add more tests based on #216 #228

Merged
merged 4 commits into from
May 16, 2023

Conversation

davidtaikocha
Copy link
Member

No description provided.


stateVars, err := s.rpc.GetProtocolStateVariables(nil)
if err != nil {
return fmt.Errorf("failed to get state variables: %w", err)
}

for {
if blockId.Cmp(big.NewInt(0)) == 0 {
lastKnownGoodBlockId = new(big.Int).SetUint64(0)
if blockId == nil && blockId.Cmp(common.Big0) == 0 {
Copy link
Contributor

@cyberhorsey cyberhorsey May 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blockId cant be both nil, and compared to 0? it should be || perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to init blockID with current L2 head, and also changed && to ||

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #228 (b6c6f82) into handle_reorg (a9151c7) will increase coverage by 3.76%.
The diff coverage is 50.00%.

❗ Current head b6c6f82 differs from pull request most recent head a6d5613. Consider uploading reports for the commit a6d5613 to get more accurate results

@@               Coverage Diff                @@
##           handle_reorg     #228      +/-   ##
================================================
+ Coverage         50.67%   54.43%   +3.76%     
================================================
  Files                36       36              
  Lines              3576     3525      -51     
================================================
+ Hits               1812     1919     +107     
+ Misses             1525     1353     -172     
- Partials            239      253      +14     
Impacted Files Coverage Δ
driver/chain_syncer/calldata/syncer.go 66.75% <50.00%> (+31.57%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@davidtaikocha davidtaikocha requested a review from cyberhorsey May 16, 2023 17:34
@davidtaikocha davidtaikocha merged commit 83fb81a into handle_reorg May 16, 2023
@davidtaikocha davidtaikocha deleted the handle_reorg_2 branch May 16, 2023 17:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants