-
Notifications
You must be signed in to change notification settings - Fork 0
benchmarks for pallets #27
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
base: main
Are you sure you want to change the base?
Conversation
…plate
🔥 refactor(lib.rs): Remove migrations module and v2 migration file
The benchmarking setup for the pallet-template has been updated to use the `frame_benchmarking::v2` module instead of `frame_benchmarking::{benchmarks, whitelisted_caller}`. This change improves compatibility with the latest version of the frame_benchmarking crate.
The migrations module and v2 migration file have been removed as they are no longer needed. The v2 migration logic has been integrated into the main pallet module, eliminating the need for a separate migrations module. This simplifies the codebase and improves maintainability.
…mplate' The workspace members in the Cargo.toml file have been reorganized to improve readability and maintain consistency. The 'pallets/template' has been added as a new member to the workspace.
… pallet 🔀 chore(Cargo.toml): update workspace package information and add new pallet The `[workspace.package]` section in `Cargo.toml` has been updated to include the authors, edition, and repository information for the project. Additionally, a new pallet named `example-basic` has been added to the list of members in the `[workspace]` section. These changes improve the project's metadata and include the new pallet in the workspace.
The commit removes unused code and files related to the `pallet-template` in the Substrate runtime. This cleanup improves code maintainability and reduces unnecessary clutter in the project. 🔥 refactor(mock.rs): remove unused mock file 🔥 refactor(tests.rs): remove unused test file The mock.rs and tests.rs files are no longer needed and have been removed. These files were not being used and were cluttering the codebase. Removing them improves code organization and reduces unnecessary files.
The Cargo.toml file is added for the example-basic pallet. This file includes package metadata such as name, version, authors, license, and description. It also specifies dependencies and features required for the pallet. This addition is necessary for proper configuration and building of the example-basic pallet.
The README.md file is added to the example-basic pallet. It contains the license information, specifically stating that the license is Unlicense.
The Cargo.toml file has been updated to include the homepage and license information. The homepage is set to "https://hashed.io" and the license is specified as "MIT". This provides additional information and clarity about the project for users and contributors.
🔀 chore(pallets): update Cargo.toml files The Cargo.toml files in the pallets directory have been updated to make the following changes: - Set the authors, homepage, edition, license, and repository fields to be workspace-specific. - Added a readme field pointing to the README.md file. These changes were made to improve consistency and provide accurate information for the pallets in the project.
The Scale trait is no longer used in the codebase, so the import statement has been removed to improve code readability and reduce unnecessary dependencies.
The offer status variants in the `OfferStatus` enum have been changed to use proper capitalization. For example, `CREATED` is now `Created`, `TF_PENDING_SIGNATURE` is now `PendingTFSignature`, and so on. This improves consistency and readability of the code. 🐛 fix(mapped-assets): remove unused constant LOG_TARGET The unused constant `LOG_TARGET` has been removed from the code. This improves code cleanliness and eliminates unnecessary clutter.
🔧 chore(tests.rs): remove unused Preservation variant In the `mock.rs` file of the `afloat` pallet, the `UncheckedExtrinsic` type is no longer used, so it has been removed. This improves code readability and reduces unnecessary code. In the `tests.rs` file of the `fund-admin` pallet, the `Preservation::Protect` variant is no longer used, so it has been removed. This simplifies the code and removes unnecessary options. In the `mock.rs` file of the `gated-marketplace` pallet, unused imports and types (`RawOrigin`, `Lookup`, `AccountId`, `AccountId32`, `ApplyExtrinsicResult`, `MultiSignature`, `Percent`, `TransactionSource`, `TransactionValidity`, `BlockT`, `IdentifyAccount`, `Verify`, `NumberFor`, `AccountIdLookup`, `impl_opaque_keys`, `
| "scale-info", | ||
| "sp-core", | ||
| "sp-io", | ||
| "sp-runtime", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,14 +1,23 @@ | |||
| [workspace.package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //get offer details | ||
| let offer = <AfloatOffers<T>>::get(order_id).unwrap(); | ||
| let is_admin_or_owner = Self::is_admin_or_owner(who.clone())?; | ||
| ensure!(is_admin_or_owner || offer.creator_id == who, Error::<T>::Unauthorized); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 6a0c05 - f30747:
- Changed the casing of
OfferStatus::CREATEDtoOfferStatus::Created - Changed the casing of
OfferStatus::TF_PENDING_SIGNATUREtoOfferStatus::PendingTFSignature - Added a
cancellation_datefield to bothOfferStatus::CreatedandOfferStatus::PendingTFSignature - Changed the
OfferStatusof bothOfferStatus::CreatedandOfferStatus::PendingTFSignaturetoOfferStatus::Cancelled
| pub mod types; | ||
|
|
||
| #[frame_support::pallet] | ||
| pub mod pallet { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use frame_system as system; | ||
| use sp_core::H256; | ||
| use sp_runtime::{ | ||
| traits::{BlakeTwo256, IdentityLookup}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // ! The statuses with "TF" refer to the transfer form that is generated after a match is formed - | ||
| // so all of the TF_* statuses come after matched | ||
| #[derive( | ||
| Encode, Decode, Clone, Eq, PartialEq, RuntimeDebugNoBound, MaxEncodedLen, TypeInfo, Copy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,59 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Added name, description, version, authors, homepage, edition, license, repository, and readme to [package] section
- Added targets to [package.metadata.docs.rs] section
- Added dependencies to [dependencies] section
- Added dev-dependencies to [dev-dependencies] section
- Added default, std, runtime-benchmarks, and try-runtime features to [features] section
| @@ -0,0 +1,118 @@ | |||
| // This file is part of Substrate. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,542 @@ | |||
| // This file is part of Substrate. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -0,0 +1,198 @@ | |||
| // This file is part of Substrate. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This git diff adds a test file for the pallet-example-basic pallet.
- It includes tests for the optional value, default value, set_dummy, signed_ext_watch_dummy, counted_map, and weights functions.
- It also includes the GenesisConfig and Config implementations for the Test runtime.
| @@ -0,0 +1,95 @@ | |||
| // This file is part of Substrate. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 4a83df - 8b7768:
- Updated
version,authors,homepage,edition,license,repository, andreadmefields in the[package]section ofCargo.toml - Added
authors.workspace,homepage.workspace,edition.workspace,license.workspace,repository.workspace, andreadmefields in the[package]section ofCargo.toml - Added
targetsfield in the[package.metadata.docs.rs]section ofCargo.toml
| @@ -1,13 +1,13 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 9fe0a4 - 416139:
- Updated the
version,authors,homepage,edition,license,publish, andrepositoryfields in the[package]section ofCargo.toml - Added
authors.workspace,homepage.workspace,edition.workspace,license.workspace,repository.workspace, andreadmefields to the[package]section ofCargo.toml - Updated the
targetsfield in the[package.metadata.docs.rs]section ofCargo.toml
| use frame_support::{ | ||
| assert_noop, assert_ok, | ||
| error::BadOrigin, | ||
| traits::{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 061dfb - b64f3b:
- Changed
versionfrom4.0.0-devto4.0.0-dev - Changed
authorsfromHashed <https://github.com/hashed-iotoauthors.workspace = true - Changed
homepagefromhttps://hashed.iotohomepage.workspace = true - Changed
editionfrom2021toedition.workspace = true - Changed
licensefromMITtolicense.workspace = true - Changed
repositoryfromhttps://github.com/hashed-io/hashed-palletstorepository.workspace = true - Added
readmewith valueREADME.md
| @@ -1,6 +1,4 @@ | |||
| use crate as pallet_gated_marketplace; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 102714 - beb263:
- Removed uses of
RawOriginandLookupfrom theusestatements - Changed
Balancetype fromu64tou128 - Changed
AccountIdtype fromu64toAccountId32 - Removed uses of
create_runtime_str,impl_opaque_keys,AccountIdLookup,BlockT,IdentifyAccount,NumberFor,Verify,ApplyExtrinsicResult,MultiSignature, andPercentfrom theusestatements
|
GPT summary of 59f1b36:
|
|
GPT summary of 34553b8:
|
|
GPT summary of 3386cd0: Error: couldn't generate summary |
|
GPT summary of 300d85d:
|
|
GPT summary of b15420a: Error: couldn't generate summary |
|
GPT summary of e595f40:
|
|
GPT summary of 0b44418:
|
|
GPT summary of ed1b78b:
|
|
GPT summary of 3522228:
PR summary so far:
|
Uh oh!
There was an error while loading. Please reload this page.