Skip to content

Conversation

didiermis
Copy link
Contributor

@didiermis didiermis commented Sep 19, 2023

Changes for fund admin records pallet

  • Updated versions of frame-support, frame-system, frame-benchmarking, sp-runtime, pallet-timestamp, sp-core, and sp-io to polkadot-v0.9.40
  • Set the signer account in the pallet
  • Added records to the pallet
  • Killed storage in the pallet
  • Updated dependencies and added dev-dependencies to multiple pallets
  • Updated #[pallet::storage_version] and #[pallet::weight] annotations for functions in fund-admin-records pallet
  • Added EnsureRoot type to frame_system and RBAC pallets
  • Updated tests for rbac pallet

… bumping versions of 'frame support', 'frame system', 'frame benchmarking', 'sp runtime', 'pallet timestamp', 'sp core' and 'sp io' to be compatible with 'polkadot-v0.9.40' from 'polkadot-v0.9.38', aligning with the latest Substrate version. This ensures our pallets stay up-to-date with the latest turnkey infrastructure enabling efficient blockchain development.

- Amended the weight ranges for three different calls - 'set_signer_account', 'add_record', and 'kill_storage' - within the Fund Admin Records pallet. We've changed the implementation to 'from_parts', explicitly setting the 'compute' part of the weight to 10,000 and 'io' part to 0. This provides a more specific weight range, optimizing on-chain resource use when these calls are processed.
@didiermis didiermis requested a review from tlacloc September 19, 2023 22:59
@didiermis didiermis self-assigned this Sep 19, 2023
@@ -390,15 +390,6 @@ dependencies = [
"libc",

Choose a reason for hiding this comment

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

GPT summary of 67b01d - 077f81:
Error: couldn't generate summary

@github-actions
Copy link

GPT summary of 9d2336b:

Error: couldn't generate summary

PR summary so far:

  • Updated versions of frame-support, frame-system, frame-benchmarking, sp-runtime, pallet-timestamp, sp-core, and sp-io to polkadot-v0.9.40
  • Set the signer account in the pallet
  • Added records to the pallet
  • Killed storage in the pallet

Copy link
Contributor

@tlacloc tlacloc left a comment

Choose a reason for hiding this comment

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

LGTM

- Updated the `pallet` macro for the Fund Admin Records pallet, specifying `STORAGE_VERSION` for better versioning control of the storage data. This ensures proper migration handling in future updates.
- Commented out certain test function bodies in the Fund Admin Records pallet. This indicates an ongoing refactoring process and tests will be revisited to ensure they align with the new implementation specifics.
- Updated the `pallet_rbac` configuration in the mock file of the Fund Admin pallet, adding `RemoveOrigin` set to `EnsureRoot<Self::AccountId>` to ensure that function calls, specific to the RBAC functionality, are executed by verified roots.
- Carried out codebase clean-up in the Gated Marketplace pallet, removing unneeded imports and fixing an incorrect closing tag on the `Config` implementation block.
- Updated the test suite for the Gated Marketplace pallet. Ensured that the `mint` function placing assets in the marketplace is correctly unwrapped using `assert_ok`. Commented out certain test cases, indicating a significant refactoring process which the tests will be revisited to align with.
- Adjusted the properties order in the pallet-rbac dependency within the Mapped Assets pallet's Cargo.toml for consistency and readability.
- Set up RBAC pallet in the test environment for the Mapped Assets pallet, implementing specific parameter types and configuring RBAC pallet for the test setup.
- Updated the test suite for the RBAC pallet. Several test cases were commented out indicating an ongoing refactoring process which the tests will be revisited to align with.
@@ -22,6 +22,7 @@ pub mod pallet {
use frame_support::traits::Time;

Choose a reason for hiding this comment

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

GPT summary of 937974 - c6aced:

  • Added const STORAGE_VERSION: StorageVersion = StorageVersion::new(1)
  • Updated #[pallet::generate_store(pub(super) trait Store)] to #[pallet::storage_version(STORAGE_VERSION)]
  • Updated #[pallet::weight(Weight::from_ref_time(10_000) + T::DbWeight::get().writes(10))] to #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] for functions set_signer_account, add_record, and kill_storage

@@ -1,5 +1,5 @@
use crate::{mock::*, types::*, Records, Error};

Choose a reason for hiding this comment

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

GPT summary of b54509 - e1cf0a:

  • Imported frame_support crate and removed BoundedVec trait
  • Commented out make_default_record_collection and make_array_record_collection functions

@@ -148,6 +148,7 @@ parameter_types! {
}

Choose a reason for hiding this comment

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

GPT summary of c0f871 - d9ec11:

  • Added type RemoveOrigin = EnsureRoot<Self::AccountId> to the pallet_rbac::Config implementation for Test

@@ -1,6 +1,6 @@
use crate as pallet_gated_marketplace;

Choose a reason for hiding this comment

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

GPT summary of 4a9270 - 89fc58:

  • Updated the use statements of pallet_gated_marketplace and frame_support
  • Updated the type statements of RemoveItemsLimit, MaxReserves, and ReserveIdentifier

@@ -756,7 +756,7 @@ fn add_authority_admin_works() {
600,

Choose a reason for hiding this comment

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

GPT summary of 4ad774 - 3f114b:
Error: couldn't generate summary

@@ -25,7 +25,7 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "pol
# `system` module provides us with all sorts of useful stuff and macros depend on it being around.

Choose a reason for hiding this comment

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

GPT summary of f2d2cb - 7f06d8:

  • Updated frame-support, frame-system, frame-benchmarking, and pallet-rbac dependencies
  • Changed the order of the attributes in pallet-rbac
  • Added sp-core dev-dependency

@@ -31,6 +31,7 @@ use sp_runtime::{
testing::Header,

Choose a reason for hiding this comment

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

GPT summary of 62d02a - 0168a3:

  • Added EnsureRoot type to frame_system pallet
  • Added RBAC pallet with parameters for MaxScopesPerPallet, MaxRolesPerPallet, RoleMaxLen, PermissionMaxLen, MaxPermissionsPerRole, MaxRolesPerUser, and MaxUsersPerRole
  • Added Rbac type to Config for Assets pallet

@@ -838,16 +838,6 @@ fn tx_create_and_set_roles_should_work() {
});

Choose a reason for hiding this comment

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

GPT summary of 9745a3 - a73e8c:

  • Removed test for creating and setting roles while not root
  • Updated tests for creating and setting roles, removing roles from users, creating and setting permissions, and assigning roles to users
  • Added tests for creating and setting roles, removing roles from users, creating and setting permissions, and assigning roles to users while not root

@github-actions
Copy link

GPT summary of 3212313:

Error: couldn't generate summary

PR summary so far:

  • Updated dependencies and added dev-dependencies to multiple pallets
  • Updated #[pallet::storage_version] and #[pallet::weight] annotations for functions in fund-admin-records pallet
  • Added EnsureRoot type to frame_system and RBAC pallets
  • Updated tests for rbac pallet

Copy link
Contributor

@tlacloc tlacloc left a comment

Choose a reason for hiding this comment

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

LGTM

@tlacloc tlacloc merged commit a8d1072 into develop Sep 21, 2023
tlacloc added a commit that referenced this pull request Sep 22, 2023
* - Updated the Fund Admin Records' list of dependencies in Cargo.toml,… (#10)

* - Updated the Fund Admin Records' list of dependencies in Cargo.toml, bumping versions of 'frame support', 'frame system', 'frame benchmarking', 'sp runtime', 'pallet timestamp', 'sp core' and 'sp io' to be compatible with 'polkadot-v0.9.40' from 'polkadot-v0.9.38', aligning with the latest Substrate version. This ensures our pallets stay up-to-date with the latest turnkey infrastructure enabling efficient blockchain development.
- Amended the weight ranges for three different calls - 'set_signer_account', 'add_record', and 'kill_storage' - within the Fund Admin Records pallet. We've changed the implementation to 'from_parts', explicitly setting the 'compute' part of the weight to 10,000 and 'io' part to 0. This provides a more specific weight range, optimizing on-chain resource use when these calls are processed.

* DEVELOPMENT AND TROUBLESHOOTING
- Updated the `pallet` macro for the Fund Admin Records pallet, specifying `STORAGE_VERSION` for better versioning control of the storage data. This ensures proper migration handling in future updates.
- Commented out certain test function bodies in the Fund Admin Records pallet. This indicates an ongoing refactoring process and tests will be revisited to ensure they align with the new implementation specifics.
- Updated the `pallet_rbac` configuration in the mock file of the Fund Admin pallet, adding `RemoveOrigin` set to `EnsureRoot<Self::AccountId>` to ensure that function calls, specific to the RBAC functionality, are executed by verified roots.
- Carried out codebase clean-up in the Gated Marketplace pallet, removing unneeded imports and fixing an incorrect closing tag on the `Config` implementation block.
- Updated the test suite for the Gated Marketplace pallet. Ensured that the `mint` function placing assets in the marketplace is correctly unwrapped using `assert_ok`. Commented out certain test cases, indicating a significant refactoring process which the tests will be revisited to align with.
- Adjusted the properties order in the pallet-rbac dependency within the Mapped Assets pallet's Cargo.toml for consistency and readability.
- Set up RBAC pallet in the test environment for the Mapped Assets pallet, implementing specific parameter types and configuring RBAC pallet for the test setup.
- Updated the test suite for the RBAC pallet. Several test cases were commented out indicating an ongoing refactoring process which the tests will be revisited to align with.

* update kill storage and bug fixes (#11)

* 🐛 fix(afloat): modify `kill_storage` function to accept `args` parameter for more granular control over storage deletion
✨ feat(afloat): add `KillStorageArgs` enum to specify different types of storage to be deleted in `kill_storage` function

* 🐛 fix(functions.rs): add authorization check in do_cancel_offer function to ensure only admin or offer creator can cancel the offer
🐛 fix(lib.rs): remove redundant authorization check in cancel_offer function

---------

Co-authored-by: Didier Mis <didier.mis.may@gmail.com>
tlacloc added a commit that referenced this pull request Sep 25, 2023
* - Updated the Fund Admin Records' list of dependencies in Cargo.toml,… (#10)

* - Updated the Fund Admin Records' list of dependencies in Cargo.toml, bumping versions of 'frame support', 'frame system', 'frame benchmarking', 'sp runtime', 'pallet timestamp', 'sp core' and 'sp io' to be compatible with 'polkadot-v0.9.40' from 'polkadot-v0.9.38', aligning with the latest Substrate version. This ensures our pallets stay up-to-date with the latest turnkey infrastructure enabling efficient blockchain development.
- Amended the weight ranges for three different calls - 'set_signer_account', 'add_record', and 'kill_storage' - within the Fund Admin Records pallet. We've changed the implementation to 'from_parts', explicitly setting the 'compute' part of the weight to 10,000 and 'io' part to 0. This provides a more specific weight range, optimizing on-chain resource use when these calls are processed.

* DEVELOPMENT AND TROUBLESHOOTING
- Updated the `pallet` macro for the Fund Admin Records pallet, specifying `STORAGE_VERSION` for better versioning control of the storage data. This ensures proper migration handling in future updates.
- Commented out certain test function bodies in the Fund Admin Records pallet. This indicates an ongoing refactoring process and tests will be revisited to ensure they align with the new implementation specifics.
- Updated the `pallet_rbac` configuration in the mock file of the Fund Admin pallet, adding `RemoveOrigin` set to `EnsureRoot<Self::AccountId>` to ensure that function calls, specific to the RBAC functionality, are executed by verified roots.
- Carried out codebase clean-up in the Gated Marketplace pallet, removing unneeded imports and fixing an incorrect closing tag on the `Config` implementation block.
- Updated the test suite for the Gated Marketplace pallet. Ensured that the `mint` function placing assets in the marketplace is correctly unwrapped using `assert_ok`. Commented out certain test cases, indicating a significant refactoring process which the tests will be revisited to align with.
- Adjusted the properties order in the pallet-rbac dependency within the Mapped Assets pallet's Cargo.toml for consistency and readability.
- Set up RBAC pallet in the test environment for the Mapped Assets pallet, implementing specific parameter types and configuring RBAC pallet for the test setup.
- Updated the test suite for the RBAC pallet. Several test cases were commented out indicating an ongoing refactoring process which the tests will be revisited to align with.

* update kill storage and bug fixes (#11)

* 🐛 fix(afloat): modify `kill_storage` function to accept `args` parameter for more granular control over storage deletion
✨ feat(afloat): add `KillStorageArgs` enum to specify different types of storage to be deleted in `kill_storage` function

* 🐛 fix(functions.rs): add authorization check in do_cancel_offer function to ensure only admin or offer creator can cancel the offer
🐛 fix(lib.rs): remove redundant authorization check in cancel_offer function

* update kill storage (#13)

* 🐛 fix(afloat): modify `kill_storage` function to accept `args` parameter for more granular control over storage deletion
✨ feat(afloat): add `KillStorageArgs` enum to specify different types of storage to be deleted in `kill_storage` function

* 🐛 fix(functions.rs): add authorization check in do_cancel_offer function to ensure only admin or offer creator can cancel the offer
🐛 fix(lib.rs): remove redundant authorization check in cancel_offer function

* Afloat update kill storage (#14)

* 🐛 fix(afloat): modify `kill_storage` function to accept `args` parameter for more granular control over storage deletion
✨ feat(afloat): add `KillStorageArgs` enum to specify different types of storage to be deleted in `kill_storage` function

* 🐛 fix(functions.rs): add authorization check in do_cancel_offer function to ensure only admin or offer creator can cancel the offer
🐛 fix(lib.rs): remove redundant authorization check in cancel_offer function

* update pallets

* 🔧 chore(rbac/functions.rs): remove unnecessary whitespace in comments for better readability
🔧 chore(rbac/functions.rs): remove unnecessary whitespace in comments for better readability

---------

Co-authored-by: Didier Mis <didier.mis.may@gmail.com>
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.

2 participants