Skip to content

Commit

Permalink
refactor: condense if/else for escrow query
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Asseman <[email protected]>
  • Loading branch information
aasseman committed Jan 15, 2024
1 parent 229b792 commit 82ce7cc
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions common/src/escrow_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ pub fn escrow_accounts(
// queries for this signer.
// isAuthorized == true means that the signer is still authorized to sign
// payments in the name of the sender.
let query_no_thawing_signers = r#"
let query = if reject_thawing_signers {
r#"
query ($indexer: ID!) {
escrowAccounts(where: {receiver_: {id: $indexer}}) {
balance
Expand All @@ -96,9 +97,9 @@ pub fn escrow_accounts(
}
}
}
"#;

let query_with_thawing_signers = r#"
"#
} else {
r#"
query ($indexer: ID!) {
escrowAccounts(where: {receiver_: {id: $indexer}}) {
balance
Expand All @@ -113,12 +114,7 @@ pub fn escrow_accounts(
}
}
}
"#;

let query = if reject_thawing_signers {
query_no_thawing_signers
} else {
query_with_thawing_signers
"#
};

timer(interval).map_with_retry(
Expand Down

0 comments on commit 82ce7cc

Please sign in to comment.