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

Impl From Asset/AssetInfo for cw-asset::Asset/AssetInfo #398

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

Rhaki
Copy link
Contributor

@Rhaki Rhaki commented Jan 5, 2024

This pull request would implement type conversation for Asset / AssetInfo with cw-asset::Asset / cw-asset::AssetInfo.

Given the popularity of the cw-asset, when dealing with astroport, conversions between the two similar types must be done manually, or implement traits to extend one of the two types.

In particular is implemented:

use cw_asset::{Asset as CwAsset, AssetInfo as CwAssetInfo};

impl From<Asset> for CwAsset;
impl TryFrom<CwAsset> for Asset;
impl From<AssetInfo> for CwAssetInfo;
impl TryFrom<CwAssetInfo> for AssetInfo;

New changes are also full tested.

Copy link
Collaborator

@epanchee epanchee left a comment

Choose a reason for hiding this comment

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

Thanks @Rhaki
LGTM!

@epanchee epanchee merged commit 8ee65ef into astroport-fi:main Jan 8, 2024
4 checks passed
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