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

fix: make sure the reset_team trait actually sets the owner #865

Merged
merged 8 commits into from
Mar 10, 2025

Conversation

rflechtner
Copy link
Contributor

@rflechtner rflechtner commented Mar 3, 2025

Fixes https://github.com/KILTprotocol/ticket/issues/3802

Changes the reset_team trait to actually set the owner passed to the function.

The trait implementation is a back-port of a trait implemented in latest versions of pallet-assets (https://docs.rs/pallet-assets/41.0.0/pallet_assets/pallet/struct.Pallet.html#impl-ResetTeam%3C%3CT+as+Config%3E::AccountId%3E-for-Pallet%3CT,+I%3E). Changing ownership of an asset is part of this trait but was not implemented here as not needed.
Nevertheless, we're adding this now to avoid mismatched expectations.

TBD

  • Update benchmarking to cover the case where the current owner != the desired owner.

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)
    • Either PR or Ticket to update the Docs
    • Link the PR/Ticket here

@rflechtner rflechtner requested a review from ntn-x2 March 5, 2025 15:06
@rflechtner rflechtner marked this pull request as ready for review March 6, 2025 16:08
@rflechtner
Copy link
Contributor Author

@ntn-x2 pinging you to have a look at this issue. What do you think about the implementation of ownership change?

_(origin as T::RuntimeOrigin, pool_id, fungibles_team, max_currencies);
_(
origin as T::RuntimeOrigin,
pool_id.clone(),
Copy link
Member

Choose a reason for hiding this comment

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

Do not clone() as part of the benchmark itself, but do it before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rflechtner rflechtner merged commit 9591662 into bonded-coins-audit-fixes Mar 10, 2025
13 of 15 checks passed
@rflechtner rflechtner deleted the fix-reset-team-traits branch March 10, 2025 12:17
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