Commit ba8ab20
fix: resolve logic issues in contract and farm mapping handlers
L1: Contract state GracePeriod fell through to OutOfFunds default in
updateNodeContract/updateNameContract. Extract parseContractState()
helper handling all 4 __kind variants (Created, Deleted, GracePeriod,
OutOfFunds) across all spec versions.
L2: nodeContractCanceled used get() instead of find() for PublicIp,
only freeing the first IP on multi-IP contracts. Remaining IPs were
orphaned with stale contractId references. Now uses find() to reset
all matching IPs.
L3: contractUpdated ignored RentContract entirely and never updated
solutionProviderID for any contract type. Add updateRentContract()
handler and solutionProviderID updates for v105+ events.
L4: farmUpdated used unsafe cast (item.event.args as Farm) to read
dedicatedFarm, which fails for v9 events where the field doesn't
exist. Replace with version-aware access via the already-parsed event
and remove the redundant second save call.
Refs: #210
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d5deadd commit ba8ab20
2 files changed
Lines changed: 48 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
202 | 217 | | |
203 | 218 | | |
204 | 219 | | |
| |||
215 | 230 | | |
216 | 231 | | |
217 | 232 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
226 | 236 | | |
227 | | - | |
228 | 237 | | |
229 | 238 | | |
230 | 239 | | |
| |||
238 | 247 | | |
239 | 248 | | |
240 | 249 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
249 | 253 | | |
250 | | - | |
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
254 | 274 | | |
255 | 275 | | |
256 | 276 | | |
| |||
272 | 292 | | |
273 | 293 | | |
274 | 294 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
279 | 301 | | |
280 | 302 | | |
281 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| |||
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | 218 | | |
221 | 219 | | |
222 | 220 | | |
| |||
0 commit comments