-
Notifications
You must be signed in to change notification settings - Fork 26
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
refactor(starknet_batcher): rename GetProposalResultError and remove the ProposalNotFound variant #2483
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2483 +/- ##
===========================================
+ Coverage 40.10% 57.15% +17.05%
===========================================
Files 26 156 +130
Lines 1895 18309 +16414
Branches 1895 18309 +16414
===========================================
+ Hits 760 10465 +9705
- Misses 1100 7378 +6278
- Partials 35 466 +431 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alonh5 and @dafnamatsry)
crates/starknet_batcher/src/batcher.rs
line 288 at r1 (raw file):
_ => return Err(BatcherError::InternalError), }, Some(Err(ProposalError::Aborted)) => return Err(BatcherError::ProposalAborted),
I think that if the proposal was aborted, the function close_input_transaction_stream would return an error.
so this match arm would never be reached.
Code quote:
Some(Err(ProposalError::Aborted)) => return Err(BatcherError::ProposalAborted),
crates/starknet_batcher/src/batcher_test.rs
line 560 at r1 (raw file):
.times(1) .with(eq(PROPOSAL_ID)) .return_once(|_| async move { None }.boxed());
I think that move is not required here,
probably in other places too.
non blocking for this PR, but we should fix separately.
Code quote:
move
f37c942
to
b241765
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alonh5 and @Yael-Starkware)
crates/starknet_batcher/src/batcher.rs
line 288 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
I think that if the proposal was aborted, the function close_input_transaction_stream would return an error.
so this match arm would never be reached.
We still need to cover it, and I think returning an error is better than panic in this case.
Also, in the following PR, I added a check at the beginning of send_proposal_content
, so if the proposal does not exist/aborted/etc. it wouldn't reach this function at all.
crates/starknet_batcher/src/batcher_test.rs
line 560 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
I think that move is not required here,
probably in other places too.
non blocking for this PR, but we should fix separately.
Right.
The tests are going to be changed a lot when the mock proposal manager will be deleted (and specifically this and almost all other expectations will be removed) . I'll keep this in mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @alonh5)
a4283c3
to
8b611aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @alonh5)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)
…the ProposalNotFound variant
8b611aa
to
372a1c5
Compare
No description provided.