-
Notifications
You must be signed in to change notification settings - Fork 308
[price-pusher] Refactor Price Pusher to support other chains #624
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
| this.targetChainPricePusher.updatePriceFeed(priceIds, pubTimesToPush); | ||
| await sleep(this.cooldownDuration * 1000); | ||
| } | ||
| } |
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.
probably a good idea to have a stop() function on this class also. It makes it easier to reuse in code (vs. as a cli)
| if (priceIds.length !== pubTimesToPush.length) | ||
| throw new Error("Invalid arguments"); | ||
|
|
||
| const priceIdsWith0x = priceIds.map((priceId) => addLeading0x(priceId)); |
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.
in the future, we should really make a class for price ids so we can expose methods like getHexStringWithLeadingZero or whatever
|
I will send other PRs for above changes! |
| return priceConfig; | ||
| }); | ||
| } | ||
|
|
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.
Why did you move it here? I think maybe it's better to be on controller.ts
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.
it is very closely related to price config.
if config changes we will need to update the should Update logic too.
controller doesn't need to know anything related to priceConfig.
I am thinking in this direction.
moved shouldUpdate to price-config as it is closely related to it
pusher changed to controller + moved the code to push updates into evm.ts
evm.ts contains everything related to evm. PriceGetter, PricePusher, Contract
one change i do think should have been in the separate PR in this file price_pusher/src/pyth-price-listener.ts