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

Fix unknown assets for ibc-out #1077

Merged
merged 1 commit into from
May 9, 2024
Merged

Conversation

Valentine1898
Copy link
Contributor

The ibc page is broken if you have unknown assets on your balance
telegram-cloud-photo-size-2-5325986573956797599-y

Copy link
Collaborator

@grod220 grod220 left a comment

Choose a reason for hiding this comment

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

Nice fix 👍

@@ -242,7 +243,6 @@ export const filterBalancesPerChain = (
const assetIdsToCheck = [penumbraAssetId, ...assetsWithMatchingChannel];

return allBalances.filter(({ balanceView }) => {
const metadata = getMetadata(balanceView);
return assetIdsToCheck.some(assetId => assetId.equals(metadata.penumbraAssetId));
return assetIdsToCheck.some(assetId => assetId.equals(getAssetIdFromValueView(balanceView)));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unknown assets also have an assetId, but no metadata.

Theoretically, this code allows for an unknown asset to be sent via IBC. But in fact, we can never match an unknown asset with an asset from some ibc channel, because in this case the asset is available in the registry and cannot be an unknown asset

@Valentine1898 Valentine1898 merged commit bf3fb31 into main May 9, 2024
6 checks passed
@Valentine1898 Valentine1898 deleted the fix-ibc-out-unknown-assets branch May 9, 2024 11:50
@Valentine1898 Valentine1898 self-assigned this May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants