fn attempt_double_spend(
        &self,
        client: &mut Client,
        transaction: &Tx,
    ) -> Result<(), TestClientError> {
        log::info!(self.logger, "Now attempting spent key image test");
        // NOTE: without the wait, the call to send_transaction would succeed.
        //       This test is a little ambiguous because it is testing that
        //       the transaction cannot even be sent, not just that it fails to
        //       pass consensus.
        std::thread::sleep(self.policy.double_spend_wait);
        match client.send_transaction(transaction) {
            Ok(_) => {
                log::error!(
                    self.logger,
                    "Double spend succeeded. Check whether the ledger is up-to-date"
                );
                Err(TestClientError::DoubleSpend)
            }
            Err(e) => {
                log::info!(self.logger, "Double spend failed with {:?}", e);
                Ok(())
            }
        }
    }
/// Attempt a double spend on the given transaction.
Attempt a double spend on the given transaction.
Attempt a double spend on the given transaction .
fn attempt_double_spend(
        &self,
        client: &mut Client,
        transaction: &Tx,
    ) -> Result<(), TestClientError> {
        log::info!(self.logger, "Now attempting spent key image test");
        // NOTE: without the wait, the call to send_transaction would succeed.
        //       This test is a little ambiguous because it is testing that
        //       the transaction cannot even be sent, not just that it fails to
        //       pass consensus.
        std::thread::sleep(self.policy.double_spend_wait);
        match client.send_transaction(transaction) {
            Ok(_) => {
                log::error!(
                    self.logger,
                    "Double spend succeeded. Check whether the ledger is up-to-date"
                );
                Err(TestClientError::DoubleSpend)
            }
            Err(e) => {
                log::info!(self.logger, "Double spend failed with {:?}", e);
                Ok(())
            }
        }
    }
fn attempt_double_spend ( & self , client : & mut Client , transaction : & Tx , ) -> Result < ( ) , TestClientError > { log :: info ! ( self logger " " ) ; // NOTE: without the wait, the call to send_transaction would succeed. //       This test is a little ambiguous because it is testing that //       the transaction cannot even be sent, not just that it fails to //       pass consensus. std :: thread :: sleep ( self . policy . double_spend_wait ) ; match client . send_transaction ( transaction ) { Ok ( _ ) => { log :: error ! ( self logger " " ) ; Err ( TestClientError :: DoubleSpend ) } Err ( e ) => { log :: info ! ( self logger " " e ) ; Ok ( ( ) ) } } }
Attempt a double spend on the given transaction.
Attempt a double spend on the given transaction .
&self
client
&mut Client
transaction
&Tx
&self
client
&mut Client
transaction
&Tx