User reported not being able to send a relatively large ODIN transaction. Investigation led to the discovery that Unspent transaction values are not being stored properly.
Transaction values are generally stored as value * 1e8 to account for possible 8 units of decimal places. So 1.0 Ø is represented as 100000000 Ø.
SQLITE was storing this with magic numbers at the end such as 100002356 which would mess up the assumed change from a spend.
The fix introduced here would save these values as raw text and then convert to a number on load. To implement this fix, I also needed to create some sort of "Migration" functionality for future use-cases where the original or loaded database schema may need to change post-launch.
User reported not being able to send a relatively large ODIN transaction. Investigation led to the discovery that
Unspenttransaction values are not being stored properly.Transaction values are generally stored as
value * 1e8to account for possible 8 units of decimal places. So1.0 Øis represented as100000000 Ø.SQLITE was storing this with magic numbers at the end such as
100002356which would mess up the assumed change from a spend.The fix introduced here would save these values as raw text and then convert to a number on load. To implement this fix, I also needed to create some sort of "Migration" functionality for future use-cases where the original or loaded database schema may need to change post-launch.