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

refactor(QueryBase): Remove constructors in derived classes #808

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

nicholaspai
Copy link
Member

@nicholaspai nicholaspai commented Dec 27, 2024

The constructor calls in AlephZeroQueries and PolygonQueries are not useful since the getTokenPrice() class function is the main changed logic from the parent QueryBase class. We can reduce LOC in the repo by removing these constructors. Additionally, we should be able to just use the parent QueryBase's constructor directly.

This was partially motivated by work on #801 where I had to modify these constructors because the QueryBase constructor changed

The constructor calls in AlephZeroQueries and PolygonQueries are not useful since the `getTokenPrice()` class function is the main changed logic from the parent `QueryBase` class. We can reduce LOC in the repo by removing these constructors.

This was partially motivated by work on #801 where I had to modify these constructors because the `QueryBase` constructor changed
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

Fair call since we're routing all instantiations through the factory class.

@nicholaspai nicholaspai marked this pull request as ready for review December 31, 2024 14:19
coingeckoProApiKey,
logger
fixedGasPrice[chainId],
"usd"
Copy link
Member Author

@nicholaspai nicholaspai Jan 2, 2025

Choose a reason for hiding this comment

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

I'm pretty sure we can just pass through and use the parent class's constructor here and therefore delete the derived construcotr in PolygonQueries and AlephZeroQueries. The only thing different in the child's constructor was changing the coingeckoBaseCurrency, which we can instead just explicitly state here when constructing the child class

@nicholaspai nicholaspai merged commit 765ef85 into base-fee-multiplier Jan 2, 2025
4 checks passed
@pxrl pxrl deleted the relayer-fee-calculator branch January 3, 2025 12:44
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.

3 participants