Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Conversation

@buffalojoec
Copy link
Contributor

Problem

We often write error variants to handle arithmetic overflow in the Solana Program Library because the error ArithmeticOverflow from solana_sdk::instruction::InstructionError does not have a counterpart in solana_program::program_error::ProgramError.

Summary of Changes

Add the ArithmeticOverflow error variant to solana_program::program_error::ProgramError.

Note: Marked as draft until rebased onto #33766

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #33767 (ed7ad04) into master (fbded92) will decrease coverage by 0.1%.
Report is 1147 commits behind head on master.
The diff coverage is 88.5%.

@@            Coverage Diff            @@
##           master   #33767     +/-   ##
=========================================
- Coverage    81.8%    81.8%   -0.1%     
=========================================
  Files         766      807     +41     
  Lines      209094   217939   +8845     
=========================================
+ Hits       171138   178304   +7166     
- Misses      37956    39635   +1679     

@buffalojoec buffalojoec force-pushed the program-error-add-arithmetic-overflow branch from 1a78c26 to abfd523 Compare October 19, 2023 16:25
@buffalojoec buffalojoec force-pushed the program-error-add-arithmetic-overflow branch from abfd523 to ed7ad04 Compare October 19, 2023 16:28
@buffalojoec buffalojoec requested a review from t-nelson October 19, 2023 16:29
@buffalojoec buffalojoec marked this pull request as ready for review October 19, 2023 16:29
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

good eye!

@buffalojoec buffalojoec added the v1.17 PRs that should be backported to v1.17 label Oct 20, 2023
@buffalojoec buffalojoec merged commit 37d093a into solana-labs:master Oct 20, 2023
mergify bot pushed a commit that referenced this pull request Oct 20, 2023
buffalojoec pushed a commit that referenced this pull request Oct 20, 2023
…33779)

program error: add `ArithmeticOverflow` (#33767)

(cherry picked from commit 37d093a)

Co-authored-by: Joe C <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

v1.17 PRs that should be backported to v1.17

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants