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

Composable-transactionMint #5276

Merged
merged 31 commits into from
Mar 20, 2023
Merged

Conversation

daiagi
Copy link
Contributor

@daiagi daiagi commented Mar 15, 2023

Thank you for your contribution to the KodaDot NFT gallery.

👇 _ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality
  • I've posted a screenshot of demonstrated change in this PR

Optional

  • I've tested it at </bsx/collection>
  • tested by minting on snek and RMRK, with and without listing for sell
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Had issue bounty label?

  • Fill up your KSM address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.

@daiagi daiagi requested a review from a team as a code owner March 15, 2023 11:27
@daiagi daiagi requested review from preschian and vikiival and removed request for a team March 15, 2023 11:27
@kodabot
Copy link
Collaborator

kodabot commented Mar 15, 2023

WARNING @daiagi PR for issue #5034 which isn't assigned to you. Please be warned that this PR may get rejected if there's another assignee for issue #5034

@netlify
Copy link

netlify bot commented Mar 15, 2023

Deploy Preview for koda-nuxt ready!

Name Link
🔨 Latest commit 2740e9f
🔍 Latest deploy log https://app.netlify.com/sites/koda-nuxt/deploys/64187d73b99a7b00084abbe7
😎 Deploy Preview https://deploy-preview-5276--koda-nuxt.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@daiagi daiagi requested a review from roiLeo March 15, 2023 11:28
composables/transaction/transactionMintToken.ts Outdated Show resolved Hide resolved
composables/transaction/transactionMintToken.ts Outdated Show resolved Hide resolved
composables/transaction/transactionMintToken.ts Outdated Show resolved Hide resolved
@daiagi
Copy link
Contributor Author

daiagi commented Mar 15, 2023

this PR covers minting Token composable
Minting collection will follow in another PR

Copy link
Member

@vikiival vikiival left a comment

Choose a reason for hiding this comment

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

^

@vikiival
Copy link
Member

Minting collection will follow in another PR

I would rather do this first

@vikiival vikiival closed this Mar 15, 2023
@vikiival
Copy link
Member

vikiival commented Mar 15, 2023

Yeah sorry, closing that was a bit harsh. Sorry for that I just overreacted

I just rather do the collections first, it is much easier and 80% of pinning logic can be extracted away.

The reasoning is this is hard to review. Contains a lot of dupictated code.

@daiagi
Copy link
Contributor Author

daiagi commented Mar 15, 2023

Yeah, it was challenging to write as well

I'll do the collection minting, sure

But as for this one, how about I split the files to make it easier read?

And there are actually no duplications
In fact I've removed duplicate code

@roiLeo roiLeo reopened this Mar 15, 2023
@vikiival
Copy link
Member

vikiival commented Mar 15, 2023

But as for this one, how about I split the files to make it easier read?

Yes please decompose pinning from the file

I'll do the collection minting, sure

Yeah I think it's easier to do.

Sorry one more time for closing that 🙈

and thanks @roiLeo for reopening that

@roiLeo
Copy link
Contributor

roiLeo commented Mar 15, 2023

Hey! I don't want to interfere but I've just tested on snek (/snek/gallery/331660682-9) and for me it works very well.
It's already a good start and it allows to get the logic out of the components (better readability). And that is what I asked when I've opened #5034.
In any case it will be useful when we'll rewrite minting experence (and maybe massmint).
Nice work, keep it up! 😉

@daiagi
Copy link
Contributor Author

daiagi commented Mar 15, 2023

Hey! I don't want to interfere but I've just tested on snek (/snek/gallery/331660682-9) and for me it works very well. It's already a good start and it allows to get the logic out of the components (better readability). And that is what I asked when I've open #5034. In any case it will be useful when we'll rewrite minting experence (and maybe massmint). Nice work, keep it up! wink

Thanks @roiLeo
Appreciate the positive feedback 😄

@vikiival
Copy link
Member

Wondering why are you refactoring SimpleMint instead of rmrk/CreateToken.vue ?

Screenshot 2023-03-15 at 14 48 16

@vikiival
Copy link
Member

But so far really good job 🤗

@daiagi
Copy link
Contributor Author

daiagi commented Mar 18, 2023

tested again by minting collection and NFT on BSX and RMRK

  • /bsx/collection/651189115
  • /rmrk/collection/669DB118F2897C6014-PLN

image
image

@vikiival
Copy link
Member

Can please @JustLuuuu or @helloitsdamsky test?

@kodadot kodadot deleted a comment from reviewpad bot Mar 20, 2023
@daiagi
Copy link
Contributor Author

daiagi commented Mar 20, 2023

/reviewpad summarize

@JustLuuuu
Copy link
Member

Can please @JustLuuuu or @helloitsdamsky test?

If Im using the correct Deploy link for testing, it's still not working for me:
Screenshot 2023-03-20 at 09 58 08

I have created a new wallet especially to test this while I was writing an article about minting on Basilisk. This account has exactly 0 bsx tokens. Only KSM (bridged). I believe even if you set KSM as a fee, it still somehow requires bsx. Test it with a wallet where you have 0 bsx.

When I tried to test it with a wallet where I had some bsx tokens. It worked.

@reviewpad
Copy link
Contributor

reviewpad bot commented Mar 20, 2023

This pull request includes various changes across multiple files. Changes involve new functions, types, and modifications to existing functions related to minting NFTs and collections. The execMintToken, execMintBasilisk, execMintCollection, execMintCollectionRmrk, useNewCollectionId, constructMeta, and useTransaction functions were added or modified. Various files such as CreateToken.vue, transactionMintCollection.ts, utils.ts, and notification.ts were also updated. Other changes include updates to import statements and regular expressions.

@daiagi
Copy link
Contributor Author

daiagi commented Mar 20, 2023

I have created a new wallet especially to test this while I was writing an article about minting on Basilisk. This account has exactly 0 bsx tokens. Only KSM (bridged). I believe even if you set KSM as a fee, it still somehow requires bsx. Test it with a wallet where you have 0 bsx.

When I tried to test it with a wallet where I had some bsx tokens. It worked.

strongly suspect it has to do with this:

@daiagi
Copy link
Contributor Author

daiagi commented Mar 20, 2023

I had a chat with @JustLuuuu who confirmed minting on Kusama works
I have also created PR #5305 to fix the minting with bridged KSM on Basilisk issue

@@ -43,33 +43,22 @@ import {
getMetadataDeposit,
getclassDeposit,
} from '@/components/unique/apiConstants'
import { getRandomValues, hasEnoughToken } from '@/components/unique/utils'
import { uploadDirect } from '@/utils/directUpload'
import { hasEnoughToken } from '@/components/unique/utils'
Copy link
Member

Choose a reason for hiding this comment

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

this will fail on Basilisk 🐍

ref:

Copy link
Contributor Author

@daiagi daiagi Mar 20, 2023

Choose a reason for hiding this comment

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

didn't touch that either, it is marked because of changed imports

it is never called..
see the comment out line below

      // await this.checkBalanceBeforeTx() 
      showNotification(
        this.$t('mint.creatingCollection', { name: this.base.name }),
        notificationTypes.info
      )
      this.status = 'loader.ipfs'
      transaction({

offsetAttribute,
secondaryFileVisible,
} from '@/components/rmrk/Create/mintUtils'
import { offsetAttribute } from '@/utils/mintUtils'
Copy link
Member

Choose a reason for hiding this comment

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

you cannot currently use offset attribute in BSX

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh ok, this is not something I've changed in this PR
It's marked because I've moved mintUtils

remove it?

components/bsx/Create/CreateToken.vue Show resolved Hide resolved
components/rmrk/Create/CreateToken.vue Show resolved Hide resolved
Comment on lines +243 to +249
setTimeout(
() =>
this.listForSale(
createdNFTs.value,
blockNumber.value as string
),
300
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this failing?

Because you can't see this in arrow fn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i was wondering the same, but no. it works


const create = api.tx.nft.mint(collectionId, nextId, metadata)

const list = price
Copy link
Member

Choose a reason for hiding this comment

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

For some magical reason someone minted token with price 0

Screenshot 2023-03-20 at 12 16 07

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry i don't follow
are you saying i should check that price isn't 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

  const list = Boolean(Number(price))
    ? [api.tx.marketplace.setPrice(collectionId, nextId, price)]
    : []

composables/useTransaction.ts Outdated Show resolved Hide resolved
@vikiival
Copy link
Member

More like suggestions otherwise LGTM

@vikiival
Copy link
Member

pay 100 usd

@yangwao
Copy link
Member

yangwao commented Mar 20, 2023

😍 Perfect, I’ve sent the payout
💵 $100 @ 35.66 USD/KSM ~ 2.804 $KSM
🧗 EfmnRhHaQqfT3phm4cUCHCU3gFVDoSPR1U9WXzMRQBMqZ4L
🔗 0xc516fcda2389cb05b71352d71bcc3885de14deface541810ad216fbb1a4dc5ab

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Mar 20, 2023
@codeclimate
Copy link

codeclimate bot commented Mar 20, 2023

Code Climate has analyzed commit 2740e9f and detected 14 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 6
Duplication 8

View more on Code Climate.

@vikiival vikiival merged commit d555927 into kodadot:main Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paid pull-request has been paid S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

composable transaction transactionMint
8 participants