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

Benchmarks Fund admin pallet #44

Merged
merged 41 commits into from
Apr 22, 2024

Conversation

didiermis
Copy link
Contributor

No description provided.

…ill be used for adding benchmarking tests for the Fund Admin pallet. Included a new module for the benchmarks and leveraged several crucial dependencies needed for runtime benchmarks. The benchmarks testing is currently empty and will be filled with individual test cases.

- Added the benchmarking module to the Fund Admin pallet's main library file. This facilitates performing benchmarking tests to ensure the optimum performance of the crate. As this action simply involves module addition, there are no significant changes to the existing functionalities.
…cts and disabled the notification for unlinked files.

- Updated source URLs in Cargo.lock to use git protocol instead of https for consistency.
…llet_balances::Pallet<Self> for the Currency type, added missing import for RawOrigin, and adjusted the test initialization to use FundAdmin::initial_setup(RawOrigin::Root.into()) for configuring initial setup.
…y linebreak and fixed indentation in the execute_with() closure. Additionally, updated the tests in tests.rs to ensure the initialization of the pallet before each test, using FundAdmin::initial_setup(RuntimeOrigin::root()). This ensures proper initialization and execution of tests.
…and sudo_remove_administrator functions in the fund-admin pallet. Also implemented utility functions generate_vector, generate_field_name, and generate_user to generate test data for benchmarking. Updated impl_benchmark_test_suite macro invocation to include the FundAdmin pallet and related dependencies.
… Changed the import for Preservation enum to only import Expendable variant instead of importing all variants individually.
…let with an admin.

- Modified benchmarks to use the newly added functions for setup.
- Implemented a benchmark for adding multiple users to the pallet at once.
…:Currency}; have been removed.

- The balances for user accounts in the GenesisConfig are now initialized properly.
…rs and users functions. Simplified the user creation process by directly pushing tuples into the users_vec vector instead of using generate_user. Adjusted the users benchmark function to iterate over the users_array and assert that user information is stored correctly in UsersInfo. Additionally, fixed the benchmark parameter x to use T::MaxRegistrationsAtTime::get() for the upper bound, ensuring consistency with the pallet configuration.
…r information. Initialized the pallet with a default size for names. Created a new user and edited their information to ensure proper functionality, including the updating of user metadata
…ument and create_array_documents functions, simplifying the error handling and parameter passing. Introduced new functions generate_banks, create_array_expenditures, create_array_job_eligibles, and create_array_users_assignations to generate sample data for benchmarks related to project creation. Added a new benchmark function projects_create_project to test project creation functionality with sample data
…ction generate_field_description to generate descriptions for fields, and modified functions create_array_expenditures, create_array_job_eligibles, and create_array_users_assignations to utilize it accordingly. Also adjusted the benchmarking parameters for project creation in the projects_create_project function and added assertions to verify project creation

Finish 7:00 pm
…generation functions generate_user and create_array_users to return Users<T> instead of BoundedVec, and similarly refactored the document generation functions to return Documents<T>. Also modified the implementation of create_array_expenditures, create_array_job_eligibles, create_array_users_assignations, and generate_banks functions to utilize try_push method for pushing elements into the bounded vectors. Additionally, introduced a new function register_users to register users and added an assertion to ensure successful user registration during project initialization.
…reate basic and full projects respectively. These functions facilitate project creation with minimal and comprehensive parameters. Also, modified the benchmarking function projects_edit_project to test the projects_edit_project extrinsic call by editing project attributes and asserting the changes.
…cts_delete_project extrinsic call by deleting a project and asserting its removal from storage.
…_assign_user extrinsic call by assigning users to a project and asserting their addition to the project's builders list.
…_type parameter.

- Added a new benchmarking function expenditures_and_job_eligibles to test the association of expenditures and job eligibles with a project.
…own and transaction generation in test parameters. I added two helper functions, `get_drawdown_id` and `get_expenditure_id`, to fetch respective ids from existing data. I also introduced the `create_array_transactions` function, which allows generating a list of transaction data in a given setup. Finally, I added a new benchmark `submit_drawdown` to simulate the business operation of handling drawdown submissions, leveraging the newly developed helper functions and data generating methods. This significantly improves the granularity and coverage of the benchmark tests.
…hensive test scenarios. I updated the `create_full_project` function to create two expenditures instead of one. I also corrected the submit_drawdown benchmark to properly reflect the status change once a drawdown is submitted. Furthermore, I added a new `approve_drawdown` benchmark to simulate and measure the performance of the drawdown approval process. This update will allow clearer visibility into the cost of approving drawdowns in different configurations. These changes will ultimately contribute to more accurate and insightful benchmarking results
… pallet. I added a new utility function `create_array_transactions_feedback` for generating test transaction data with feedback information. Also, updated the `submit_drawdown` benchmark to match the new array transactions' size. To test the process of rejection, I added a new benchmark test `reject_drawdown` to simulate the scenario of rejecting a drawdown submission, alongside validating the status change to 'Rejected'.
…test simulates the bulk uploading process for Developer Equity drawdowns, creating an array of documents and submitting them. The test evaluates the performance aspect of the uploading process and verifies that the drawdown status is updated to 'Submitted' post submission.
…a new function `create_array_inflation_rate` for generating test data of project inflation rates. I also introduced a benchmark test `inflation_rate` that evaluates the update operation of inflation rates for multiple projects sequentially, and verifies that these updates have been correctly applied in the storage.
… constructing a new function `create_array_revenue_transactions` to generate test data of revenue transactions. Plus, created a new benchmark test `submit_revenue` to simulate submitting revenue and ensuring the status of the revenue is correctly updated to 'Submitted' after submission.
…Fund Admin pallet. The test initialize the pallet, creates a full project, and then creates a revenue submission on behalf of an eligible job. It checks that the revenue submission was successful and that the status of the revenue is correctly set to 'Approved'. The changes aim to ensure that the `approve_revenue` function works as expected and maintains a consistent performance.
…ich verifies the functionality and performance of the `RejectRevenue` extrinsic. The test includes initialization of the pallet, creating a full project, submitting a revenue, and then rejecting it with transaction feedback. The assert statements validate that the revenue has been updated with the status 'Rejected'. This work improves our testing coverage and validates the performance of revenue rejecting functionality.
…objects in both `create_array_transactions` and `create_array_revenue_transactions` functions for better readability and maintainability. Updated several benchmark testing functions such as `reject_revenue` and `bank_confirming_documents` ensuring the function parameters are clear and concise. A new benchmark testing function `bank_confirming_documents` has been added to measure the performance of confirming documents operation. Minor changes were made to improve the coding standards and readability of the file, like adjusting the line length for better readability.
…ion tests the performance of resetting a drawdown status to Draft. The test first submits a drawdown then verifies the status has switched to Submitted. After that, it triggers the reset operation and confirms that the drawdown status has been reset to Draft successfully. This function is useful in validating and measuring the performance of the drawdown reset operation.
Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 0b0ac66:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 46e2e1f:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 8bad448:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 2ad7323:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 005c708:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 7dbe6bd:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of ce09abf:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 8fcd2c1:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of ec9aef3:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of dc1fc2a:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of ca60b2f:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 6cce738:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 880610b:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of b64d6b3:

Error: couldn't generate summary

Copy link

github-actions bot commented Apr 9, 2024

GPT summary of 33335fb:

Error: couldn't generate summary

PR summary so far:

Error: couldn't generate summary

…insics to use the new weights, updated afloat pallet benchmarks to remove unneeded storage maps population, updated frame-weigth-template.hbs file to use the newest version, removed no longer needed fund-admin extrinc . closes #39
@@ -1,10 +1,11 @@
{{header}}

Choose a reason for hiding this comment

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

GPT summary of 9c9e29 - ecd384:
Error: couldn't generate summary

@@ -1,9 +1,9 @@
{

Choose a reason for hiding this comment

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

GPT summary of 60cb53 - 8b4656:
Error: couldn't generate summary

@@ -11,13 +11,12 @@ use frame_support::{
use frame_system::{Config as SystemConfig, RawOrigin};

Choose a reason for hiding this comment

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

GPT summary of bedfd4 - 09d5aa:
Error: couldn't generate summary

@@ -2,6 +2,8 @@

Choose a reason for hiding this comment

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

GPT summary of 66ec36 - 67a45f:
Error: couldn't generate summary

@@ -101,7 +101,7 @@ impl pallet_fund_admin::Config for Test {
type Timestamp = Timestamp;

Choose a reason for hiding this comment

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

GPT summary of 826f56 - f073c2:
Error: couldn't generate summary

Copy link

GPT summary of b2c3a40:

Error: couldn't generate summary

Copy link

GPT summary of 06ade91:

Not generating summary for merge commits

Copy link

GPT summary of 76bc2dc:

Error: couldn't generate summary

PR summary so far:

Error: couldn't generate summary

@sebastianmontero sebastianmontero merged commit 09ba7bf into feature/benchmarks Apr 22, 2024
1 check passed
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.

3 participants