-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The negative check will give an incorrect result for values like -0.1, which is parsed as -0*AI3 + 0.1*AI3:
| if (result <= 0n) throw new Error('Amount must be > 0'); |
But all negative values are excluded by the regexes, so this is not an issue in practice:
| if (!/^[0-9]+(\.[0-9]+)?$/.test(s)) throw new Error('Invalid AI3 amount'); |
| if (!/^[0-9]+$/.test(s)) throw new Error('Invalid amount: only digits allowed (shannons)'); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels