-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add cache to registry #256
Conversation
update foreign asset multilocation caching
From an initial look. I think the registry should have implemented getters and setters that either look for a given item in the cache, or set an item in the cache. For example:
NOTE: We already know the specname, and the relaychain so we dont need those values as args. |
great idea! Ill modify this to reflect the getter setter structure |
Some additional thoughts.
OR
OR
type GenericAsset<T> = T extends 'foreignAsset'
? <some_type>
: T extends 'liquidPools'
? <some_type>
: T extends 'assetpallet'
? <some_type>
: never;
...
public setAssetIdInCache<T>(asset: GenericAsset<T>, type: T)
... |
src/createXcmTypes/util/foreignAssetMultiLocationIsInCacheOrRegistry.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits to address on the above. But overall really solid PR!
move cache initialization into registry constructor update cache setter getter param names to be more clear
remove unneeded comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits, but really amazing job!
closes: #225