Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use constants for repeated test values #127

Open
mantricjavier opened this issue Feb 13, 2025 · 0 comments
Open

Use constants for repeated test values #127

mantricjavier opened this issue Feb 13, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@mantricjavier
Copy link
Collaborator

If you want to report a security issue, please follow our security policy: https://github.com/MANTRA-Chain/mantra-dex/blob/main/docs/SECURITY.md


Improvement description

The test uses magic numbers like 6u8 for decimals repeatedly. Consider extracting these into named constants.

const DEFAULT_DECIMAL_PLACES: u8 = 6;
const DEFAULT_POOL_AMOUNT: u128 = 1_000_000;
const DEFAULT_SWAP_AMOUNT: u128 = 1_000;

// Usage:
vec![DEFAULT_DECIMAL_PLACES, DEFAULT_DECIMAL_PLACES]

Additional context

Add any other context here, code snippets, json responses, screenshots and so on.

Code sample
Logs

Screenshots

@mantricjavier mantricjavier added the enhancement New feature or request label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant