Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

fix decimal_to_bcs func#83

Merged
anushaali-26 merged 2 commits intomainfrom
fix-decimal_to_bcs-method
Apr 2, 2025
Merged

fix decimal_to_bcs func#83
anushaali-26 merged 2 commits intomainfrom
fix-decimal_to_bcs-method

Conversation

@anushaali-26
Copy link
Contributor

@anushaali-26 anushaali-26 commented Apr 2, 2025

User description

Description

  • removed self from decimal_to_bcs func as it's not a class method

Checklist:

  • All changes in this PR are at least one version backwards compatible, (reverting this PR is safe eg data migrations are backwards compatible).
  • I have performed a thorough self-review of my code
  • I have commented the code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md, architecture docs, public docs, etc).

PR Type

Bug fix


Description

  • Removed self parameter from decimal_to_bcs function.

  • Updated decimal_to_bcs to be a standalone function.


Changes walkthrough 📝

Relevant files
Bug fix
utilities.py
Refactor `decimal_to_bcs` to standalone function                 

src/sui_utils/utilities.py

  • Removed self parameter from decimal_to_bcs function.
  • Made decimal_to_bcs a standalone function.
  • +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @anushaali-26 anushaali-26 requested a review from a team as a code owner April 2, 2025 09:28
    @qodo-code-review
    Copy link

    Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Indentation Issue

    The function body appears to be indented incorrectly. The code inside the function should be aligned with the function definition, not indented further.

    # Initialize an empty list to store the BCS bytes
    bcs_bytes = []
    while num > 0:
        # Take the last 7 bits of the number

    @qodo-code-review
    Copy link

    qodo-code-review bot commented Apr 2, 2025

    Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix indentation error

    The function has incorrect indentation. The function body is indented one level
    too deep, which will cause syntax errors when the code is executed.

    src/sui_utils/utilities.py [183-187]

     def decimal_to_bcs(num):
    -    # Initialize an empty list to store the BCS bytes
    -    bcs_bytes = []
    -    while num > 0:
    -        # Take the last 7 bits of the number
    +# Initialize an empty list to store the BCS bytes
    +bcs_bytes = []
    +while num > 0:
    +    # Take the last 7 bits of the number
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    __

    Why: The suggestion correctly identifies a critical indentation error in the function body. The code as shown in the PR has excessive indentation that would cause syntax errors when executed. Fixing this indentation is essential for the function to work properly.

    High
    • Update

    @anushaali-26 anushaali-26 changed the title fix decimal_to_bcs. func fix decimal_to_bcs func Apr 2, 2025
    @anushaali-26 anushaali-26 merged commit 6a4487b into main Apr 2, 2025
    @anushaali-26 anushaali-26 deleted the fix-decimal_to_bcs-method branch April 2, 2025 11:26
    Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants