substrate
substrate copied to clipboard
[Uniques V2] Tips
This PR adds a new pay_tips method.
Since the royalties shouldn't be enforced on the pallet/contract level, we still need a way to allow marketplaces to set them optionally. One possible solution would be to use batched transactions, but then it won't be possible for any UI/BCX to distinguish between tips paid and regular payments. This PR solves this by adding a new pay_tips method and emitting the TipSent event.
"This PR adds a new param to the buy_item method." - it does not currently do that, it adds a new method to the pallet. Tbh I was expecting an Option<Tip> on the buy_item method. Does the tip go to the NFT creator automatically or does it go to the marketplace?
https://github.com/paritytech/substrate/blob/5a48536a49859f83dbbbab1285311f14c192e7b1/frame/support/src/traits/tokens/misc.rs#L142 - we seem to have bitfields to indicate why we are sending money - perhaps a ROYALTY flag could be added there? But then there's no reference to point out which NFT it's a tip for.
Yeah, if you check the commits history, initially I put an Option<Tips> param into the item_buy. Then I realised there could be more methods those would want to get the optional tips added like buy_from_seller or any other method which is not there yet. By extracting the tips payment into a separate method we could allow to combine that easily with any other method without modifying the params.
But then there's no reference to point out which NFT it's a tip for. I think this is critical for a lot of external systems to know the NFT's id when the tip is sent
I've converted tuple into struct as per Oliver suggestion
/cmd queue -c bench-bot $ pallet dev pallet_nfts
"$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_nfts was queued.
Comment /cmd cancel 39-2447c807-b90b-4b3f-a8cb-d7eb57b94db7 to cancel this command or /cmd cancel to cancel all commands in this pull request.
@jsidorenko Command "$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_nfts has finished. Result:
ValidationError: "id" is required
ValidationError: "id" is required
{"message":{"base":["Reference not found"]}}
/cmd queue -c bench-bot $ pallet dev pallet_nfts
@jsidorenko https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1863666 was started for your command "$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_nfts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment /cmd cancel 40-c5f21d37-a293-4d9d-bc87-04738e57d03d to cancel this command or /cmd cancel to cancel all commands in this pull request.
@jsidorenko Command "$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_nfts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1863666 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1863666/artifacts/download.
Looks good to me
/cmd queue -c bench-bot $ pallet dev pallet_nfts
@jsidorenko https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1877941 was started for your command "$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_nfts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment /cmd cancel 51-443c6567-f6b2-4642-b502-6edec1dbcf21 to cancel this command or /cmd cancel to cancel all commands in this pull request.
@jsidorenko Command "$PIPELINE_SCRIPTS_DIR/bench-bot.sh" pallet dev pallet_nfts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1877941 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1877941/artifacts/download.
bot merge