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

Update ZORA default quantity to 1 #50

Merged
merged 1 commit into from
Sep 1, 2024
Merged

Conversation

christinehall
Copy link
Contributor

@christinehall christinehall commented Sep 1, 2024

PR Type

enhancement


Description

  • Updated the default quantity for ZORA timed mint strategy from 11 to 1.
  • Adjusted the mint price calculation to accommodate the new default quantity.

Changes walkthrough 📝

Relevant files
Enhancement
zora-metadata.ts
Update default quantity and adjust mint price calculation

src/ingestors/zora-internal/zora-metadata.ts

  • Changed the default quantity from 11 to 1 for ZORA timed mint
    strategy.
  • Adjusted mint price calculation to reflect the new default quantity.
  • +1/-1     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @qodo-merge-pro qodo-merge-pro bot added the enhancement New feature or request label Sep 1, 2024
    Copy link

    qodo-merge-pro bot commented Sep 1, 2024

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Potential Logic Issue
    The condition for adjusting the mint price (line 149) is still checking for 111000000000000, which might need to be updated to reflect the new default quantity of 1.

    Copy link

    qodo-merge-pro bot commented Sep 1, 2024

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Maintainability
    Extract magic number into a named constant for better code readability

    Consider using a constant for the price threshold (111000000000000) to improve code
    readability and maintainability.

    src/ingestors/zora-internal/zora-metadata.ts [149-152]

    -if (parseInt(mintPriceWei) <= 111000000000000) {
    +const PRICE_THRESHOLD = 111000000000000;
    +if (parseInt(mintPriceWei) <= PRICE_THRESHOLD) {
       defaultQuantity = 1;
       mintPriceWei = (BigInt(mintPriceWei) * BigInt(defaultQuantity)).toString();
     }
     
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Using a named constant for the price threshold improves code readability and maintainability by making the code more self-explanatory and easier to update if the threshold changes.

    7
    Documentation
    Add a comment explaining the purpose of the price threshold check

    Consider adding a comment explaining the significance of the 111000000000000
    threshold and why it affects the defaultQuantity.

    src/ingestors/zora-internal/zora-metadata.ts [149-152]

    +// If the mint price is below or equal to 0.000111 ETH (111000000000000 wei),
    +// set the default quantity to 1 and adjust the mint price accordingly
     if (parseInt(mintPriceWei) <= 111000000000000) {
       defaultQuantity = 1;
       mintPriceWei = (BigInt(mintPriceWei) * BigInt(defaultQuantity)).toString();
     }
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Adding a comment provides clarity on the significance of the threshold value and its impact on the logic, which aids in understanding the code's purpose and behavior.

    6
    Consistency
    Use consistent BigInt parsing for numeric comparisons

    Consider using BigInt.parse() instead of parseInt() for consistency with other
    BigInt operations in the code.

    src/ingestors/zora-internal/zora-metadata.ts [149]

    -if (parseInt(mintPriceWei) <= 111000000000000) {
    +if (BigInt.parse(mintPriceWei) <= BigInt(111000000000000)) {
     
    • Apply this suggestion
    Suggestion importance[1-10]: 5

    Why: Using BigInt.parse() instead of parseInt() would improve consistency with other BigInt operations, but BigInt.parse() is not a standard JavaScript method. The suggestion is incorrect as it proposes a non-existent method.

    5

    Copy link

    qodo-merge-pro bot commented Sep 1, 2024

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    CI Failure Feedback 🧐

    Action: build

    Failed stage: Run Tests [❌]

    Failed test name: createMintTemplateForUrl: Returns a mint template for a supported URL

    Failure summary:

    The action failed because the test createMintTemplateForUrl: Returns a mint template for a supported
    URL did not pass. The test failed due to an AssertionError where the expected condition was true,
    but the actual result was false.

    Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    513:  ✅ Simulation success
    514:  ✔ createMintTemplateForUrl: Returns a mint template for a supported URL (1184ms)
    515:  ✔ createMintForContract: Returns a mint template for a supported contract (455ms)
    516:  fxhash
    517:  ✔ supportsUrl: Returns false for an unsupported URL
    518:  ✔ supportsUrl: Returns true for a supported URL
    519:  ✔ createMintTemplateForUrl: Returns a mint template for a supported URL with frame contract (334ms)
    520:  ✔ createMintTemplateForUrl: Returns a mint template for a supported URL with fixed price contract (214ms)
    521:  ✔ createMintTemplateForUrl: Throws error if the mint for fxhash is on mainnet or tezos (1592ms)
    522:  ✔ createMintTemplateForUrl: Throws error if incompatible URL
    523:  ✔ createMintTemplateForUrl: Throws error if non-existent project (1780ms)
    524:  ✔ createMintTemplateForContract: Returns a mint template for a supported contract (138ms)
    525:  ✔ createMintTemplateForContract: Throws error for a non supported contract (46ms)
    ...
    
    587:  rarible
    588:  ✔ supportsUrl: Returns false for an unsupported URL
    589:  ✔ supportsUrl: Returns true for a supported URL
    590:  ✔ supportsContract: Returns false for a unsupported contract (1161ms)
    591:  ✔ supportsContract: Returns true for a supported contract (1532ms)
    592:  ✔ supportsContract: Returns false for a non base chain supported contract (695ms)
    593:  ✔ createMintForContract: Returns a mint template for a supported base contract (1045ms)
    594:  ✔ createMintTemplateForUrl: Returns a mint template for a supported URL (821ms)
    595:  ✔ createMintTemplateForUrl: Throws error if incompatible URL
    ...
    
    658:  ✔ ERC7160TL stack (542ms)
    659:  ✔ ERC721TL stack (509ms)
    660:  createMintTemplateForContract: Returns a mint template for a supported contract
    661:  ✔ ERC1155TL contract at 0x7c3a99d4a7adddc04ad05d7ca87f4949c1a62fa8 (344ms)
    662:  ✔ ERC7160TL contract at 0xd2f9c0ef092d7ffd1a5de43b6ee546065461887d (292ms)
    663:  ✔ ERC721TL contract at 0x999f084f06ee49a3deef0c9d1511d2f040da4034 (307ms)
    664:  108 passing (57s)
    665:  1 pending
    666:  1 failing
    667:  1) highlight
    668:  HighlightIngestor-auto
    669:  createMintTemplateForUrl: Returns a mint template for a supported URL:
    670:  AssertionError: expected false to be true
    ...
    
    728:  mint-template-builder.ts   |    71.3 |    65.51 |   53.12 |    71.3 | ...,210-212,215-217,220-222 
    729:  lib/simulation              |   71.07 |    60.71 |      70 |   71.07 |                             
    730:  simulation.ts              |   64.53 |    63.15 |   66.66 |   64.53 | ...0-74,125,127,131,138-141 
    731:  tenderly.ts                |   85.71 |    55.55 |      75 |   85.71 | 52-60                       
    732:  lib/simulation/types        |     100 |      100 |     100 |     100 |                             
    733:  tenderly.types.ts          |     100 |      100 |     100 |     100 |                             
    734:  lib/types                   |     100 |      100 |     100 |     100 |                             
    735:  index.ts                   |     100 |      100 |     100 |     100 |                             
    736:  mint-ingestor-error.ts     |     100 |      100 |     100 |     100 |                             
    737:  mint-ingestor.ts           |     100 |      100 |     100 |     100 |                             
    738:  mint-template.ts           |     100 |      100 |     100 |     100 |                             
    739:  -----------------------------|---------|----------|---------|---------|-----------------------------
    740:  error Command failed with exit code 1.
    741:  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    742:  ##[error]Process completed with exit code 1.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    @chrismaddern chrismaddern merged commit 2c29b91 into main Sep 1, 2024
    1 check failed
    @chrismaddern chrismaddern deleted the christine/zora-default-qty branch September 1, 2024 11:20
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants