Commit e8244e8
committed
- Added a safe addition helper function,
- Defined a new `ArithmeticOverflow` error in the Fund Admin Pallet to provide feedback for operations that can potentially cause arithmetic overflow. This helps increase the robustness of our numeric operations.
- Introduced two new test cases `replicate_overflow_for_a_drawdown_submission` and `replicate_overflow_for_a_revenue_submission` in the Fund Admin Pallet test suite to ensure accurate arithmetic overflow detection. These tests validate that the system correctly rejects drawdown and revenue submissions which would result in arithmetic overflow conditions. This expands the coverage of our testing and ensures the safe operation of financial transactions.safe_add, to the Fund Admin Pallet to mitigate risks from arithmetic overflow. This function checks if the addition of two numbers results in an overflow and, if so, throws the ArithmeticOverflow error. This check has been incorporated into the do_calculate_drawdown_total_amount and do_calculate_revenue_total_amount functions to ensure safe addition operation and provide user feedback.1 parent 69418f7 commit e8244e8
4 files changed
+99
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2008 | 2008 | | |
2009 | 2009 | | |
2010 | 2010 | | |
2011 | | - | |
2012 | | - | |
2013 | | - | |
2014 | | - | |
2015 | | - | |
2016 | | - | |
2017 | | - | |
| 2011 | + | |
| 2012 | + | |
2018 | 2013 | | |
2019 | 2014 | | |
2020 | 2015 | | |
| |||
3125 | 3120 | | |
3126 | 3121 | | |
3127 | 3122 | | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
3128 | 3128 | | |
3129 | 3129 | | |
3130 | 3130 | | |
| |||
3145 | 3145 | | |
3146 | 3146 | | |
3147 | 3147 | | |
| 3148 | + | |
| 3149 | + | |
3148 | 3150 | | |
3149 | 3151 | | |
3150 | 3152 | | |
| |||
3298 | 3300 | | |
3299 | 3301 | | |
3300 | 3302 | | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
3301 | 3306 | | |
3302 | 3307 | | |
3303 | 3308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| 697 | + | |
| 698 | + | |
697 | 699 | | |
698 | 700 | | |
699 | 701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4174 | 4174 | | |
4175 | 4175 | | |
4176 | 4176 | | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
| 4203 | + | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
| 4212 | + | |
| 4213 | + | |
| 4214 | + | |
| 4215 | + | |
| 4216 | + | |
| 4217 | + | |
| 4218 | + | |
| 4219 | + | |
| 4220 | + | |
4177 | 4221 | | |
4178 | 4222 | | |
4179 | 4223 | | |
| |||
5790 | 5834 | | |
5791 | 5835 | | |
5792 | 5836 | | |
| 5837 | + | |
| 5838 | + | |
| 5839 | + | |
| 5840 | + | |
| 5841 | + | |
| 5842 | + | |
| 5843 | + | |
| 5844 | + | |
| 5845 | + | |
| 5846 | + | |
| 5847 | + | |
| 5848 | + | |
| 5849 | + | |
| 5850 | + | |
| 5851 | + | |
| 5852 | + | |
| 5853 | + | |
| 5854 | + | |
| 5855 | + | |
| 5856 | + | |
| 5857 | + | |
| 5858 | + | |
| 5859 | + | |
| 5860 | + | |
| 5861 | + | |
| 5862 | + | |
| 5863 | + | |
| 5864 | + | |
| 5865 | + | |
| 5866 | + | |
| 5867 | + | |
| 5868 | + | |
| 5869 | + | |
| 5870 | + | |
| 5871 | + | |
| 5872 | + | |
| 5873 | + | |
| 5874 | + | |
| 5875 | + | |
| 5876 | + | |
5793 | 5877 | | |
5794 | 5878 | | |
5795 | 5879 | | |
| |||
0 commit comments