Repository navigation
fix(assets): resolve origin-chain symbols for Ethereum destinations - #2533
Closed
Townsvilledh wants to merge 1 commit into
Closed
Townsvilledh wants to merge 1 commit into
Townsvilledh wants to merge 1 commit into
Conversation
With an Ethereum/EthereumTestnet destination, findAssetInfoBySymbol returned only Ethereum-origin (GlobalConsensus) matches and nothing else, so origin-chain assets supported for Snowbridge routes (DOT, KSM, MYTH) could not be selected by symbol, and the Ethereum filter hardcoded chainId 1 so no symbol resolved for EthereumTestnet. The lookup now uses the destination's own chainId (Ethereum 1, EthereumTestnet 11155111) and falls back to the regular native/other asset lookup when no Ethereum-origin asset matches, keeping Ethereum-origin matches at priority. Adds unit tests for the fallback (plain and Foreign), the testnet chainId, and Ethereum-match priority. Signed-off-by: Townsvilledh <132020127+Townsvilledh@users.noreply.github.com> AI-Assisted-By: Muse
Contributor
|
Dear @Townsvilledh Unfortunately in order to contribute you need to have issue reserved for you. The original reporter needs to say they do not want to carry out the FIX. You also did not adhere to bug bounty PR format. More information on program: https://paraspell.github.io/docs/contribution-guidelines.html Closing. With kind regards, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐞 Bug Fix Pull Request
📌 Related Issue
Closes #2394
🛠️ Description of the Fix
findAssetInfoBySymbol(packages/assets/src/assets/search/findAssetInfoBySymbol.ts), when the destination is an external chain, both the plain-symbol path and theForeign()path returnedfindEthMatch(symbol, otherAssets)immediately.findEthMatchonly searches assets whose location isGlobalConsensus: { Ethereum: { chainId: 1 } }, so (1) origin-chain assets that the SDK supports for Snowbridge transfers could not be selected by symbol —findAssetInfo('Hydration', { symbol: 'DOT' }, 'Ethereum'),Foreign('DOT'), andfindAssetInfo('Mythos', { symbol: 'MYTH' }, 'Ethereum')all returnednulleven though the same assets resolve by location and appear ingetSupportedAssets(...)— and (2) no symbol at all resolved forEthereumTestnet, whose assets use chainId11155111, not the hardcoded1.Ethereum→ 1,EthereumTestnet→ 11155111), threaded throughfindEthMatch/findEthAssetBySymbol. When no Ethereum-origin asset matches, the lookup falls back to the regular native/other-asset resolution instead of returningundefined, so origin-chain assets supported for the route resolve by symbol — exactly the behaviour the issue's Expected Behavior section asks for. Ethereum-origin matches keep priority when both exist. Added 5 unit tests: DOT by plain symbol and byForeign()with an Ethereum destination, a native asset (MYTH) by symbol with an Ethereum destination, a chainId-11155111 WETH resolving forEthereumTestnet, and Ethereum-match priority over a same-symbol origin asset. The issue's own real-data reproduction (Hydration DOT / Mythos MYTH / AssetHubPaseo WETH) also passes against the fixed code, and the fullfindAssetInfo.test.tssuite passes (40/40).✅ Contributor Eligibility
Reasonable(verifiable via Subscan). — Done: Reasonable judgement from dotID (registrar 5), given 2026-11-14 11:26 UTC.-S) and includesSigned-off-byandAI-Assisted-By: <tool name(s)>(orAI-Assisted-By: None) trailers.✅ Checklist
main.)💸 Polkadot Asset Hub Address (for Reward)
Polkadot Asset Hub Address:
16PaYuRJxLGN3D7CjQ1CXJwCgTrWeErTHXAYUngWACPD28vo🧩 Additional Notes (Optional)
Disclosure and eligibility status, stated plainly:
AI-Assisted-By: Musetrailer, per the programme's transparency rules. One eligibility box above is left unticked rather than falsely claimed: the human-authorship box does not describe AI-assisted work, so it is explained here instead. The People Chain identity/judgement is DONE — Reasonable judgement from dotID, given 2026-11-14 11:26 UTC.packages/assets/src/assets/search/findAssetInfo.test.ts— 40/40 pass (35 pre-existing + 5 new); the issue's real-data reproduction passes (Hydration → Ethereum DOT by symbol andForeign('DOT'), Mythos → Ethereum MYTH, AssetHubPaseo → EthereumTestnet WETH, with the AssetHubPolkadot → Ethereum WETH mainnet control still resolving); the changed file typechecks clean undertsc --strict.@michaeldev5 requesting review when you have a moment. Thank you!