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(SpokePoolClient): Move findDeposit to helper function file #799

Closed
wants to merge 1 commit into from

Conversation

nicholaspai
Copy link
Member

This function findDeposit is only used by queryHistoricalDepositForFill, a utility function. I propose moving this helper function closer to the helper function as it doesn't need to be a client level function. Though, it does make lots of spoke pool client calls but I see it just as intuitive to pass in the relevant spoke pool client into the function. The function effecitvely "finds a deposit" using a spoke pool client's memory.

This function `findDeposit` is only used by `queryHistoricalDepositForFill`, a utility function. I propose moving this helper function closer to the helper function as it doesn't need to be a client level function. Though, it does make lots of spoke pool client calls but I see it just as intuitive to pass in the relevant spoke pool client into the function. The function effecitvely "finds a deposit" using a spoke pool client's memory.
@@ -125,6 +127,73 @@ export async function queryHistoricalDepositForFill(
};
}

export async function findDeposit(
Copy link
Contributor

Choose a reason for hiding this comment

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

Also RE #798 (comment), I think this will make it more difficult to handle an SVM integration, because the caller (or this function) will need to consider whether the target chain is evm or svm.

So in general my preference would be to route calls via the SpokePoolClient, and have it implement pointers to the correct underlying interfaces depending on whether it's evm or svm.

Copy link
Member Author

Choose a reason for hiding this comment

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

hm i'm ok with that

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