Commit 3736162
committed
fix: clamp negative amounts to 0 in AmountWrapper deserializer
The staking service can send negative remainingStakingAmount (e.g.
"-2282880") when the unstake amount exceeds the current balance.
The u64 deserializer rejected these with "invalid digit found in
string", preventing the intent from being processed at all.
The intent builder already guards with > 0 checks before using
amount values (e.g. partial unstake in build.rs), so clamping
negatives to 0 at deserialization is safe and lets the full unstake
path proceed correctly.
Ticket: BTC-31841 parent 962b78c commit 3736162
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
| |||
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
169 | | - | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
176 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
| |||
0 commit comments