Skip to content

test: fix with custom transport #755

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

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

dohaki
Copy link
Contributor

@dohaki dohaki commented Oct 24, 2024

No description provided.

@dohaki dohaki requested review from pxrl, gsteenkamp89 and bmzig October 24, 2024 15:30
@@ -74,6 +75,7 @@ class ExampleQueries implements QueryInterface {
constructor(private defaultGas = "305572") {}

getGasCosts(): Promise<TransactionCostEstimate> {
console.log("#####");
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw you can use the logger in test by running LOG_IN_TEST=yes yarn test ....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah ok good to know

@dohaki dohaki requested a review from pxrl October 28, 2024 11:10
Comment on lines +75 to +80
options: Partial<{
gasPrice: BigNumberish;
gasUnits: BigNumberish;
omitMarkup: boolean;
transport: Transport;
}> = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for this approach - I really think it improves usability to eliminate the need for long convoluted sets of parameters.


// This needs to be implemented for every chain and passed into RelayFeeCalculator
export interface QueryInterface {
getGasCosts: (
deposit: Deposit,
relayer: string,
gasPrice?: BigNumberish,
gasLimit?: BigNumberish
options?: Partial<{ gasPrice: BigNumberish; gasUnits: BigNumberish; omitMarkup: boolean; transport: Transport }>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be nice to avoid having Transport bleed out into the QueryInterface definitions. I'm not sure if that's acheivable atm and it may not be actionable right now. But in general I think it would be good to keep the implementation choices of the gas price oracle defined internally - especially since it's only really used for test (...it might hint at the need to define a special class for test? idk).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So currently we use getGasCosts directly in the API. That's why I had to expose it here 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But yea agree it would be nicer to keep it internal

@dohaki dohaki merged commit 370b4ee into pxrl/experimentalGas Oct 28, 2024
4 checks passed
@dohaki dohaki deleted the fix-tests-gas-experimental branch October 28, 2024 13:12
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.

2 participants