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

refactor: remove destroy witness #445

Closed
wants to merge 39 commits into from

Conversation

chungquantin
Copy link
Collaborator

Remove the witness data required as parameter from destroy() dispatchable function of nonfungibles pallet.

  • Pros: Improve developer experience.
  • Cons: Pre-dispatch weight charged up to u32::MAX.

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.90%. Comparing base (5316da1) to head (76acc65).

@@                              Coverage Diff                               @@
##           chungquantin/feat-main_pallet_nonfungibles     #445      +/-   ##
==============================================================================
- Coverage                                       73.93%   73.90%   -0.03%     
==============================================================================
  Files                                              76       76              
  Lines                                           15237    15227      -10     
  Branches                                        15237    15227      -10     
==============================================================================
- Hits                                            11265    11254      -11     
  Misses                                           3711     3711              
- Partials                                          261      262       +1     
Files with missing lines Coverage Δ
pallets/api/src/nonfungibles/mod.rs 97.10% <100.00%> (+0.05%) ⬆️
pallets/api/src/nonfungibles/tests.rs 99.82% <100.00%> (-0.01%) ⬇️
runtime/devnet/src/config/api/mod.rs 90.97% <100.00%> (-0.20%) ⬇️

... and 1 file with indirect coverage changes

@chungquantin chungquantin force-pushed the chungquantin/feat-main_pallet_nonfungibles branch from df27276 to ea59ba3 Compare January 22, 2025 05:13
@chungquantin chungquantin force-pushed the chungquantin/feat-destroy_witness branch from c90d2c1 to 76acc65 Compare January 24, 2025 17:14
@peterwht
Copy link
Collaborator

Unfortunately, I think the devex of removing the witness (forcing high fees) does not outweigh the benefits of not requiring the witness.

A few things, destroy is likely something that is infrequently called. Additionally, I feel a better solution will be here: #432 (comment). However, to take that idea further, we can allow the smart contract to provide an optional maybe_witness. That way the choice is up to the SC developer.

Base automatically changed from chungquantin/feat-main_pallet_nonfungibles to main February 4, 2025 07:36
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.

4 participants