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

Small refactor #6983

Merged
merged 4 commits into from
Aug 30, 2023
Merged

Small refactor #6983

merged 4 commits into from
Aug 30, 2023

Conversation

pbkompasz
Copy link
Contributor

@pbkompasz pbkompasz commented Aug 27, 2023

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

👇 __ 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

Optional

  • I've tested it at </ksm/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Did your issue had any of the "$" label on it?

  • Fill up your DOT address: Payout

Community participation

Screenshot 📸

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

Copilot Summary

🤖 Generated by Copilot at 8cab8c8

This pull request refactors and simplifies some functions in the composables/massmint/parsers, utils, and stores modules. The main goal is to improve code quality, modularity, performance, and clarity.

🤖 Generated by Copilot at 8cab8c8

We slice the history with our splicing blade
We parse the text and process every block
We execute the transactions with our hash of rage
We refactor the code and unleash the metal shock

@pbkompasz pbkompasz requested a review from a team as a code owner August 27, 2023 10:00
@pbkompasz pbkompasz requested review from preschian and roiLeo and removed request for a team August 27, 2023 10:00
@netlify
Copy link

netlify bot commented Aug 27, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 59b4c07
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64edd50dfa0d300008a5016e
😎 Deploy Preview https://deploy-preview-6983--koda-canary.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 configuration.

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 27, 2023

AI-Generated Summary: This pull request consists of three patches which carry out refactoring tasks across several files.

  1. In the first patch, the utils/transactionExecutor.ts file sees a refactor where code related to fetching the transaction hash has been extracted into a separate async function named getHash(). This helps compartmentalize different aspects of the transaction execution.

  2. The second patch refactors the parseTxt and processBlock functions in composables/massmint/parsers/parseTxt.ts. The block processing logic has been extracted into its own function, updateEntries(), which simplifies the process of adding entries. The parseTxt function then leverages updateEntries() for improved readability and functionality.

  3. In the final patch, the addHistoryItem() function in stores/history.ts has been refactored for simplicity and readability. It looks for the id alone from payload. If the NFT was visited before, it makes sure to delete it from history first and lastly if there are more than 30 items in visitedNFTs, it pops from end and unshifts the new item at the beginning.

@reviewpad reviewpad bot added medium Pull request is medium waiting-for-review labels Aug 27, 2023
@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 27, 2023

Reviewpad Report

⚠️ Warnings

  • Please link an issue to the pull request

Copy link
Member

@floyd-li floyd-li left a comment

Choose a reason for hiding this comment

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

small stuff otherwise lgtm

composables/massmint/parsers/parseTxt.ts Outdated Show resolved Hide resolved
@codeclimate
Copy link

codeclimate bot commented Aug 29, 2023

Code Climate has analyzed commit 59b4c07 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Aug 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@yangwao
Copy link
Member

yangwao commented Aug 30, 2023

@prury can have check on mass mint if I see right code part 👀

@prury
Copy link
Member

prury commented Aug 30, 2023

@prury prury added the S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked label Aug 30, 2023
@yangwao
Copy link
Member

yangwao commented Aug 30, 2023

pay 50 usd

@yangwao yangwao merged commit fcf492b into kodadot:main Aug 30, 2023
15 checks passed
@yangwao
Copy link
Member

yangwao commented Aug 30, 2023

😍 Perfect, I’ve sent the payout
💵 $50 @ 4.58 USD/DOT ~ 10.917 $DOT
🧗 16hqk8Tjugo9AwSzKkxXc1dsRK7iJetpx1YBaoXYwdHzuNAt
🔗 0x2acb3ba7f681e6daa0a3c31d7f3206e323dfed3402ed616f98a247b8c937f141

🪅 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 Aug 30, 2023
This was referenced Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium Pull request is medium paid pull-request has been paid S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants