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

AssetInfo implementations #22

Merged
merged 3 commits into from
Jan 2, 2024
Merged

AssetInfo implementations #22

merged 3 commits into from
Jan 2, 2024

Conversation

Rhaki
Copy link
Contributor

@Rhaki Rhaki commented Dec 27, 2023

This pull request would add some useful implementations to AssetInfo:

  • Added #[derive(Eq, PartialOrd, Ord, Hash)] to AssetInfoBase<T: AddressLike> allowing to use AssetInfoBase as key for both HashMap and BTreeMap;
  • Implemented fn inner() for AssetInfo which return the inner cw20 addr or denom wrapped within;
  • Prefix and Suffix types have been changed from () - () to String - String on PrimaryKey implementation for AssetInfo. This allow to iterate over a Map<AssetInfo, T> by prefix that can be cw20: or native: (colon is required to match with the first key generated in fn key() on PrimaryKey implementation);
  • Tests have been created to assert these implementations.

src/asset_info.rs Outdated Show resolved Hide resolved
src/asset_info.rs Show resolved Hide resolved
src/asset_info.rs Outdated Show resolved Hide resolved
@Rhaki
Copy link
Contributor Author

Rhaki commented Jan 2, 2024

A New commit with review changes has been pushed

src/asset_info.rs Outdated Show resolved Hide resolved
Fix test comment

Co-authored-by: piobab <piobab0x@proton.me>
@piobab
Copy link
Contributor

piobab commented Jan 2, 2024

Thanks for update. LGTM

@piobab piobab merged commit 7a68fdc into mars-protocol:main Jan 2, 2024
@Rhaki
Copy link
Contributor Author

Rhaki commented Jan 8, 2024

@piobab Is possible to release the new version also on Crates.io?

@piobab
Copy link
Contributor

piobab commented Jan 9, 2024

@Rhaki I can publish as 3.1.0 version. Makes sense?

@Rhaki
Copy link
Contributor Author

Rhaki commented Jan 9, 2024

@piobab LGTM

@piobab
Copy link
Contributor

piobab commented Jan 10, 2024

@Rhaki please take a look #23

@Rhaki
Copy link
Contributor Author

Rhaki commented Jan 11, 2024

@piobab LGTM!
I could have some useful features that could be added, in case i'll open a new PR based also on the usability of the latest features added with this PR, try to add all of them in a single PR

@piobab
Copy link
Contributor

piobab commented Jan 11, 2024

Thx for contribution! Great job! New version published in crates.io

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.

2 participants