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

Deepanshutr/chore #435

Merged
merged 58 commits into from
Apr 15, 2024
Merged

Deepanshutr/chore #435

merged 58 commits into from
Apr 15, 2024

Conversation

deepanshutr
Copy link
Member

No description provided.

The test cases in several query modules have been refactored. The order, meta, asset, and maintainer modules now use keys instead of IDs for test cases. This involves updating the relevant fields and test data. The change enhances code consistency and test coverage for the application.
This commit adds a new function GenerateUniqueIdentifierList in the utilities module. The function generates a list of unique IDs with a given prefix and count, which can be used for testing and client utility purposes.
Added error handling for the auxiliary module and expanded test coverage for better integrity checking and robustness. Improved tests in the helpers/base package, especially for auxiliaries and cli_flag. Updated error handling and validations for auxiliary initializations and operations to prevent panics and ensure data integrity.
…unctions in transaction_keeper_test.go

The changes involve updating import paths to retrieve necessary modules like orders, identities, metas, classifications, and dependencies like cosmos-sdk or IBC modules from github. The transaction_keeper test has major enhancements which mainly revolve around creating a more comprehensive test setup as well as updating the parameters for wrapping transactions.
Instead of directly returning the error in ValidateBasic function, the error messages are now wrapped with details for better debugging. This change mainly affects the error handling mechanism within the sdkTypes.AccAddressFromBech32, FromID.ValidateBasic, and Coins.Validate functions, and also refines the coins length error message.
The update adds various new test cases to the ValidateBasic method in message_test.go. These cover scenarios like multiple coins, duplicate denom, and an excessive number of coins. New invalid request errors have been added to handle incorrect from address, from id, coin amount and coin denom.
Instead of directly returning the error in ValidateBasic function, the error messages are now wrapped with details for better debugging. This change mainly affects the error handling mechanism within the sdkTypes.AccAddressFromBech32, FromID.ValidateBasic, and Coins.Validate functions, and also refines the coins length error message.
The update adds various new test cases to the ValidateBasic method in message_test.go. These cover scenarios like multiple coins, duplicate denom, and an excessive number of coins. New invalid request errors have been added to handle incorrect from address, from id, coin amount and coin denom.
Instead of directly returning the error in ValidateBasic function, the error messages are now wrapped with details for better debugging. This change mainly affects the error handling mechanism within the sdkTypes.AccAddressFromBech32, FromID.ValidateBasic, and Coins.Validate functions, and also refines the coins length error message.
Expanded message_test.go with various test cases that cover scenarios for validating basic Message fields, including address, ID, asset, and value. These tests ensure that the correct error handling occurs for all possible cases in the validation process.
This update replaces usage of generic error messages in message validation methods of wrap, unwrap, and send transactions. These have been replaced with custom errors for invalid situations such as incorrect address, invalid id, etc. This provides more clear debugging information and improves error tracking.
…alidMessage"

The error name "IncorrectMessage" has been refactored to "InvalidMessage" throughout the codebase to better reflect its meaning. This change affects all modules and tests where this error name is used, improving code clarity and consistency.
@github-actions github-actions bot added the test label Apr 8, 2024
The validation in transfer's auxiliaryRequest struct has been updated to use ValidateBasic() function rather than using govalidator. This change provides a more specific validation ensuring the IDs are valid and the value is greater than zero.
The validation process in the mint auxiliary request class of the x splits module was revamped. Instead of using the 'govalidator' package for validation, each attribute is now individually validated using 'ValidateBasic' method and error messages are handled more precisely.
The test method Test_auxiliaryRequestFromInterface has been removed from the mint auxiliary request test file in the x splits module. This change simplifies the test structure and streamlines the module by eliminating unnecessary testing of auxiliaryRequestFromInterface function.
Revised auxiliary tests in the mint module of the x splits package. Unnecessary test cases have been removed, including testing of auxiliaryRequestFromInterface function. Also, new test scenarios were added for improved code coverage and validity checks. The helper function "createTestInput" was removed and replaced with global variables for better readability and consistency.
Refactored the Help function in the mint module's auxiliary helper to enhance input validation and error handling. It now validates the AuxiliaryRequest explicitly and returns custom error for invalid request type. This update ensures more robust code execution and improved debugging capability.
This commit removes the 'Test_auxiliaryRequestFromInterface' function from the 'auxiliary_request_test.go' file. The test was deemed unnecessary and not contributing any value to the testing suite.
This commit replaces the govalidator usage for auxiliaryRequest validation with custom error checking. It also removes unnecessary `valid` struct tags and enhances error messages. Now validation checks for specifics: the validity of both owner ids, asset ids and makes sure that value is greater than zero.
This commit refactors the process of validation in auxiliaryRequest and its corresponding test cases. The update replaces the use of govalidator with custom error checking, removes unnecessary 'valid' struct tags, and enhances the clarity of error messages. The validation now specifically checks the validity of the owner and asset IDs, and ensures that the value is greater than zero.
The updated code includes enhanced validation processes in the auxiliary request function, now using custom error checking. It ensures the validity of the owner and asset IDs and checks that the value is greater than zero. It also offers improved error messages by replacing govalidator, removing unnecessary 'valid' struct tags and therefore making the overall testing more concise and clear.
Copy link

sonarcloud bot commented Apr 12, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
39.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Member Author

@deepanshutr deepanshutr left a comment

Choose a reason for hiding this comment

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

self reviewed

@deepanshutr deepanshutr merged commit 4b95837 into master Apr 15, 2024
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant