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

docs: add panics section #5574

Merged
merged 1 commit into from
Nov 26, 2023
Merged

docs: add panics section #5574

merged 1 commit into from
Nov 26, 2023

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Nov 26, 2023

ref #5572

But I don't even think we should panic here:

(self.transactions_by_tx_range(tx_range.clone())?, self.senders_by_tx_range(tx_range)?)
};
let body = transactions
.into_iter()
.map(|tx| match transaction_kind {
TransactionVariant::NoHash => TransactionSigned {
// Caller explicitly asked for no hash, so we don't calculate it
hash: Default::default(),
signature: tx.signature,
transaction: tx.transaction,
},
TransactionVariant::WithHash => tx.with_hash(),
})
.collect();
Ok(Some(Block { header, body, ommers, withdrawals }.with_senders(senders)))

panicking here seems bad @rkrasiuk

I guess we should recover them if the ranges don't match for any reason whatsoever.

@mattsse mattsse added the C-debt Refactor of code section that is hard to understand or maintain label Nov 26, 2023
Copy link
Member

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

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

agreed, we should fix it

@mattsse mattsse added this pull request to the merge queue Nov 26, 2023
Merged via the queue into main with commit 8e6fb6b Nov 26, 2023
27 checks passed
@mattsse mattsse deleted the matt/add-panic-note branch November 26, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants