-
Notifications
You must be signed in to change notification settings - Fork 21
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: create senders based on escrow account version #624
Changes from 8 commits
75d1b7d
033cdaa
342fad5
2ba1960
4f28961
4bded36
da09924
d70e7e2
50b7dc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,12 +95,33 @@ pub async fn escrow_accounts( | |
reject_thawing_signers: bool, | ||
) -> Result<EscrowAccountsWatcher, anyhow::Error> { | ||
indexer_watcher::new_watcher(interval, move || { | ||
get_escrow_accounts(escrow_subgraph, indexer_address, reject_thawing_signers) | ||
get_escrow_accounts_v1(escrow_subgraph, indexer_address, reject_thawing_signers) | ||
}) | ||
.await | ||
} | ||
|
||
async fn get_escrow_accounts( | ||
pub async fn escrow_accounts_v2( | ||
escrow_subgraph: &'static SubgraphClient, | ||
indexer_address: Address, | ||
interval: Duration, | ||
reject_thawing_signers: bool, | ||
) -> Result<EscrowAccountsWatcher, anyhow::Error> { | ||
indexer_watcher::new_watcher(interval, move || { | ||
get_escrow_accounts_v2(escrow_subgraph, indexer_address, reject_thawing_signers) | ||
}) | ||
.await | ||
} | ||
|
||
// TODO implement escrow accounts v2 query | ||
async fn get_escrow_accounts_v2( | ||
_escrow_subgraph: &'static SubgraphClient, | ||
_indexer_address: Address, | ||
_reject_thawing_signers: bool, | ||
) -> anyhow::Result<EscrowAccounts> { | ||
Ok(EscrowAccounts::new(HashMap::new(), HashMap::new())) | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add TODO: Change query for temporary implementation of subgraph handling both v1 and V2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's already a TODO on top of the function. Do you want me to change the message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just tried to mean that the current comment kind of only sounds for v2 and we might need to modify also v1 query later There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the moment you change the provided schema old queries will break so you will quickly realize that you need to change the query. On the other hand, this won't break and that's why there's a TODO |
||
async fn get_escrow_accounts_v1( | ||
escrow_subgraph: &'static SubgraphClient, | ||
indexer_address: Address, | ||
reject_thawing_signers: bool, | ||
|
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.
I think this function should be renamed to escrow_accounts_v1, it can make it a bit confusing? since in every other spot you are making the difference in the names between v1 and v2 and this could give the idea is generic for both versions
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.
You are absolutely right, I just didn't want to change this because it would have tons of other changes (since it's also used in service).
I could I do this renaming in a follow-up PR, unless you think it's mandatory.
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.
Maybe just create an issue so that this is not forgotten?