async fn execute_command(&mut self, command: TxCommand) -> Result<(), Aborted> {
        // We consider API errors to be somewhat likely, thus we will retry the operation if it fails
        // due to connection issues.
        const MAX_RETRIES: usize = 3;

        let mut attempt = 0;
        loop {
            let start = Instant::now();
            let result = self.execute_tx_command(&command).await;

            let submit_result = match result {
                Ok(result) => result,
                Err(err) if Self::should_retry(&err) => {
                    if attempt < MAX_RETRIES {
                        tracing::warn!("Error while sending tx: {err}. Retrying...");
                        // Retry operation.
                        attempt += 1;
                        continue;
                    }

                    // We reached the maximum amount of retries.
                    let error = format!("Retries limit reached. Latest error: {err}");
                    SubmitResult::ReportLabel(ReportLabel::failed(error))
                }
                Err(err) => {
                    // Other kinds of errors should not be handled, we will just report them.
                    SubmitResult::ReportLabel(ReportLabel::failed(err.to_string()))
                }
            };

            match submit_result {
                SubmitResult::TxHash(tx_hash) => {
                    self.inflight_txs.push_back(InflightTx {
                        tx_hash,
                        start,
                        attempt,
                        command: command.clone(),
                    });
                    self.successfully_sent_txs.write().await.push(tx_hash)
                }
                SubmitResult::ReportLabel(label) => {
                    // Make a report if there was some problems sending tx
                    self.report(label, start.elapsed(), attempt, command)
                        .await?;
                }
            }

            // We won't continue the loop unless `continue` was manually called.
            break;
        }
        Ok(())
    }
Executes a command with support of retries:
If command fails due to the network/API error, it will be retried multiple times
before considering it completely failed. Such an approach makes us a bit more resilient to
volatile errors such as random connection drop or insufficient fee error.
core/tests/loadnext/src/account/mod.rs