Skip to content

Commit

Permalink
chore: skip api call if no updates
Browse files Browse the repository at this point in the history
  • Loading branch information
matteojug committed Oct 3, 2024
1 parent 54387d0 commit 48f9d7a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions signer/src/emily_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ impl EmilyInteract for EmilyClient {
RequestRef::Deposit(d) => Some(d),
_ => None,
});

let mut update_request = Vec::new();
for deposit in deposits {
update_request.push(DepositUpdate {
Expand All @@ -125,6 +126,12 @@ impl EmilyInteract for EmilyClient {
status_message: "TODO?".to_string(),
});
}

if update_request.is_empty() {
// Skip the call
return Ok(UpdateDepositsResponse { deposits: vec![] });
}

let update_request = UpdateDepositsRequestBody { deposits: update_request };

deposit_api::update_deposits(&self.config, update_request)
Expand Down

0 comments on commit 48f9d7a

Please sign in to comment.