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

chore(interchain-token-service): verify input validation #208

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AttissNgo
Copy link
Contributor

@AttissNgo AttissNgo commented Jan 24, 2025

- prohibit deploying token with negative supply
- minor cleanup on docstring
@AttissNgo AttissNgo requested a review from a team as a code owner January 24, 2025 21:39
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.43%. Comparing base (ca3b486) to head (a29e46b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #208   +/-   ##
=======================================
  Coverage   95.43%   95.43%           
=======================================
  Files          62       62           
  Lines        3593     3595    +2     
=======================================
+ Hits         3429     3431    +2     
  Misses        164      164           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -229,6 +229,8 @@ impl InterchainTokenServiceInterface for InterchainTokenService {

caller.require_auth();

ensure!(initial_supply >= 0, ContractError::InvalidSupply);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no minter and 0 initial supply is a weird case that we can check for too

/// Returns `ContractError` if the deployment fails, the token ID is invalid, or token metadata is invalid.
/// - `ContractError::InvalidDestinationChain`: If the `destination_chain` is the current chain.
/// - `ContractError::InvalidTokenId`: If the token ID is invalid.
/// - Errors propagated from `token_metadata`.
Copy link
Contributor

@ahramy ahramy Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Is this necessary? If so, we need to update similar docstrings for other functions for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's consistent with the rest of the ITS docstring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants