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

add from_dict() wrappers to spl/token/instructions.py #478

Closed
wants to merge 2 commits into from

Conversation

azerv1
Copy link
Contributor

@azerv1 azerv1 commented Dec 11, 2024

related #344

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.18%. Comparing base (a5434bc) to head (138ca9b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #478      +/-   ##
==========================================
+ Coverage   92.00%   92.18%   +0.17%     
==========================================
  Files          27       27              
  Lines        2226     2277      +51     
==========================================
+ Hits         2048     2099      +51     
  Misses        178      178              

@azerv1 azerv1 changed the title related #344 add from_dict() wrappers to spl/token/instructions.py Dec 11, 2024
Comment on lines 32 to 36
@classmethod
def from_dict(cls, params: dict) -> "AuthorityType":
"""AuthorityType dict wrapper."""
return cls(**params)

Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
@classmethod
def from_dict(cls, params: dict) -> "AuthorityType":
"""AuthorityType dict wrapper."""
return cls(**params)

This one is not necessary as it is an Enum

@michaelhly
Copy link
Owner

michaelhly commented Dec 11, 2024

Would you mind updating the corresponding unit tests here?

def test_initialize_mint(stubbed_sender):

@kevinheavey
Copy link
Collaborator

What does this achieve? Can't the user already call ApproveParams(**params)?

@azerv1
Copy link
Contributor Author

azerv1 commented Dec 11, 2024

you are right. I falsely assumed that you were asking for something like python coding style convention. But regarding #344 , can you explain what more pythonic is?

@azerv1 azerv1 closed this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants