-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[NFTs] Update attributes with offchain signature #13390
Conversation
Co-authored-by: Squirrel <gilescope@gmail.com>
# Conflicts: # frame/nfts/src/weights.rs
# Conflicts: # frame/nfts/src/benchmarking.rs # frame/nfts/src/common_functions.rs # frame/nfts/src/lib.rs # frame/nfts/src/mock.rs # frame/nfts/src/tests.rs # frame/nfts/src/types.rs # frame/nfts/src/weights.rs
This is mostly looking good to me, just asking some questions, since I'm not very familiar with the codebase of this. |
@jsidorenko Command |
bot bench $ pallet dev pallet_nfts |
@jsidorenko https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2395409 was started for your command Comment |
One other thing that I have noticed - this branch seems to be based on a branch that has already been merged to master, so the commit history is kinda messy. I know this does not matter much with squash and merge, just pointing it out as it makes things a bit confusing, though the diff is pretty clear. |
Also, if there is a tracking issue for that - it might be great to mention it in the PR description. And potentially make sure that the PR closes it. |
This is happening, because the same branch is being used that has already been merged. For future work I would definitely make sure that the changeset is based on master to avoid confusion for both reviewers and posterity. |
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 changeset looks good to me, apart from the issues I mentioned that have to do with commit history.
I agree, I needed to cherry-pick the commits. I tried to do the rebase and got into the conflicts hell, so decided just to use merge :) |
@jsidorenko Command |
Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
bot merge |
* Allow to mint with the pre-signed signatures * Another try * WIP: test encoder * Fix the deposits * Refactoring + tests + benchmarks * Add sp-core/runtime-benchmarks * Remove sp-core from dev deps * Enable full_crypto for benchmarks * Typo * Fix * Update frame/nfts/src/mock.rs Co-authored-by: Squirrel <gilescope@gmail.com> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add docs * Add attributes into the pre-signed object & track the deposit owner for attributes * Update docs * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add the number of attributes provided to weights * Support pre-signed attributes * Update docs * Fix merge artifacts * Update docs * Add more tests * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Update frame/nfts/src/types.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update types.rs --------- Co-authored-by: Squirrel <gilescope@gmail.com> Co-authored-by: command-bot <> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Allow to mint with the pre-signed signatures * Another try * WIP: test encoder * Fix the deposits * Refactoring + tests + benchmarks * Add sp-core/runtime-benchmarks * Remove sp-core from dev deps * Enable full_crypto for benchmarks * Typo * Fix * Update frame/nfts/src/mock.rs Co-authored-by: Squirrel <gilescope@gmail.com> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add docs * Add attributes into the pre-signed object & track the deposit owner for attributes * Update docs * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add the number of attributes provided to weights * Support pre-signed attributes * Update docs * Fix merge artifacts * Update docs * Add more tests * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Update frame/nfts/src/types.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update types.rs --------- Co-authored-by: Squirrel <gilescope@gmail.com> Co-authored-by: command-bot <> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Allow to mint with the pre-signed signatures * Another try * WIP: test encoder * Fix the deposits * Refactoring + tests + benchmarks * Add sp-core/runtime-benchmarks * Remove sp-core from dev deps * Enable full_crypto for benchmarks * Typo * Fix * Update frame/nfts/src/mock.rs Co-authored-by: Squirrel <gilescope@gmail.com> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add docs * Add attributes into the pre-signed object & track the deposit owner for attributes * Update docs * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add the number of attributes provided to weights * Support pre-signed attributes * Update docs * Fix merge artifacts * Update docs * Add more tests * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Update frame/nfts/src/types.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update types.rs --------- Co-authored-by: Squirrel <gilescope@gmail.com> Co-authored-by: command-bot <> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Allow to mint with the pre-signed signatures * Another try * WIP: test encoder * Fix the deposits * Refactoring + tests + benchmarks * Add sp-core/runtime-benchmarks * Remove sp-core from dev deps * Enable full_crypto for benchmarks * Typo * Fix * Update frame/nfts/src/mock.rs Co-authored-by: Squirrel <gilescope@gmail.com> * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add docs * Add attributes into the pre-signed object & track the deposit owner for attributes * Update docs * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Add the number of attributes provided to weights * Support pre-signed attributes * Update docs * Fix merge artifacts * Update docs * Add more tests * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_nfts * Update frame/nfts/src/types.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Update types.rs --------- Co-authored-by: Squirrel <gilescope@gmail.com> Co-authored-by: command-bot <> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
This PR allows to set/update NFT's attributes by providing an offchain signature.
Attribute's deposit in that case will be taken from the origin and not the signer.
This approach significantly improves the user experience, since in a standard flow the user first needs to give a permission to modify his attributes, then the external account would need to submit an attribute update extrinsic.
A possible use-case would be the evolvable nft tickets. By doing some offchain actions, the NFT's holder could get a pre-signed update to his attributes and submit it whether he sees the value.
Cumulus Companion: paritytech/cumulus#2189