Skip to content

Conversation

johnsaigle
Copy link
Contributor

  • Change TokenConfigEntry.Decimals field from int64 to uint8 for more appropriate data type
  • Rename tokenEntry.decimals to scalingFactor with clarifying comment explaining it represents 10^decimals
  • Add comprehensive error checking in computeValue function to prevent nil pointer dereferences and division by zero
  • Add test cases to validate token prices are positive and decimals are within sensible bounds (0-24)

@johnsaigle johnsaigle added governor quality doesn't fix a known bug, doesn't change behavior, but increase code quality test labels Aug 14, 2025
- Change TokenConfigEntry.Decimals field from int64 to uint8 for more appropriate data type
- Rename tokenEntry.decimals to scalingFactor with clarifying comment explaining it represents 10^decimals
- Add comprehensive error checking in computeValue function to prevent nil pointer dereferences and division by zero
- Add test cases to validate token prices are positive and decimals are within sensible bounds (0-24)
@johnsaigle johnsaigle force-pushed the governor-type-safety-and-scalingfactor branch from 60df009 to 752dbdf Compare August 14, 2025 20:25
@johnsaigle johnsaigle marked this pull request as ready for review August 14, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
governor quality doesn't fix a known bug, doesn't change behavior, but increase code quality test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant