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

AssetIndicesMixin asset_names setter and tests #193

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

allt0ld
Copy link
Collaborator

@allt0ld allt0ld commented Aug 7, 2023

Description

  • AssetIndicesMixin children such as SimCurvePool and SimCurveMetaPool now have a convenient interface for setting the AssetIndicesMixin.asset_names attribute. Basic checks ensure that no duplicate names are set and that the number of asset names remains consistent after initialization.
  • In AssetIndicesMixin.asset_balances, the instance raises a CurveSimException if its asset_names and _asset_balances aren't the same length, ensuring that they will be.
  • Expanded test coverage in curvesim.test.unit.test_coin_indices_mixin. Invalid data such as nonexistent asset indices or duplicate asset indices are passed to AssetIndicesMixin.get_asset_indices() to check the proper errors are raised.

Resolves #172, resolves #187.

NOTE: should only be merged once metadata is set on CurvePool, CurveMetaPool, CurveCryptoPool __init__ rather than after, which is how it's currently done (#195). SimCurveCryptoPool will have to implement the setter after this gets merged.

Hygiene checklist

  • Changelog entry
  • Everything public has a Numpy-style docstring
    (modules, public functions, classes, and public methods)
  • Commit history is cleaned-up with minor changes squashed together
    and descriptive commit messages following Tim Pope's style

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@allt0ld allt0ld added enhancement New feature or request priority: low tech debt Shoulda, coulda, but didn't labels Aug 7, 2023
@allt0ld allt0ld self-assigned this Aug 7, 2023
@allt0ld allt0ld requested review from nagakingg and chanhosuh August 7, 2023 22:12
@allt0ld allt0ld marked this pull request as draft September 9, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: low tech debt Shoulda, coulda, but didn't
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate coin names and balances Complete AssetIndicesMixin tests
1 participant