Skip to content

fix(rpc): add division by zero guard#845

Merged
thiagodeev merged 1 commit intomainfrom
rdr/fix-test-tip-estimate
Mar 25, 2026
Merged

fix(rpc): add division by zero guard#845
thiagodeev merged 1 commit intomainfrom
rdr/fix-test-tip-estimate

Conversation

@rodrodros
Copy link
Copy Markdown
Contributor

@rodrodros rodrodros commented Mar 25, 2026

Note

Low Risk
Low risk test-only change that prevents a possible division-by-zero panic when the captured block contains no transactions.

Overview
Improves rpc/utils_test.go by marking getTipAverageFromBlock as a test helper and returning 0 when the block has no transactions, preventing a division-by-zero when computing the average tip.

Written by Cursor Bugbot for commit 6feef13. This will update automatically on new commits. Configure here.

@rodrodros
Copy link
Copy Markdown
Contributor Author

Mock test is failing is due to the addition of Proof Facts and unrelated to this PR change

@github-project-automation github-project-automation bot moved this to 👀 In review in [Nubia] Starknet.go Mar 25, 2026
@thiagodeev thiagodeev merged commit 0f7158d into main Mar 25, 2026
7 of 8 checks passed
@thiagodeev thiagodeev deleted the rdr/fix-test-tip-estimate branch March 25, 2026 11:18
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in [Nubia] Starknet.go Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants