/// Deletes the account corresponding to the provided `id` from Redis.
/// Returns the deleted account (tokens remain encrypted)
Deletes the account corresponding to the provided `id` from Redis.
Returns the deleted account (tokens remain encrypted)
Deletes the account corresponding to the provided ` id ` from Redis . Returns the deleted account ( tokens remain encrypted )
async fn redis_delete_account(
        &self,
        id: Uuid,
    ) -> Result<AccountWithEncryptedTokens, NodeStoreError> {
        let encrypted = self.redis_get_account(id).await?;
        let account = &encrypted.account;
        let mut pipe = redis_crate::pipe();
        pipe.atomic();
        pipe.srem(
            &*prefixed_key(&self.db_prefix, ACCOUNTS_KEY),
            RedisAccountId(account.id),
        )
        .ignore();
        pipe.del(&*accounts_key(&self.db_prefix, account.id))
            .ignore();
        pipe.hdel(
            &*prefixed_key(&self.db_prefix, USERNAMES_KEY),
            account.username().as_ref(),
        )
        .ignore();
        if account.should_send_routes() {
            pipe.srem(
                &*prefixed_key(&self.db_prefix, SEND_ROUTES_KEY),
                RedisAccountId(account.id),
            )
            .ignore();
        }
        if account.should_receive_routes() {
            pipe.srem(
                &*prefixed_key(&self.db_prefix, RECEIVE_ROUTES_FROM_KEY),
                RedisAccountId(account.id),
            )
            .ignore();
        }
        if account.ilp_over_btp_url.is_some() {
            pipe.srem(
                &*prefixed_key(&self.db_prefix, BPT_OUTGOING),
                RedisAccountId(account.id),
            )
            .ignore();
        }
        pipe.hdel(
            &*prefixed_key(&self.db_prefix, ROUTES_KEY),
            account.ilp_address.to_bytes().to_vec(),
        )
        .ignore();
        pipe.del(uncredited_amount_key(&self.db_prefix, id));
        let mut connection = self.connection.clone();
        pipe.query_async(&mut connection).await?;
        update_routes(connection, self.routes.clone(), &self.db_prefix).await?;
        debug!("Deleted account {}", account.id);
        Ok(encrypted)
    }
async fn redis_delete_account ( & self , id : Uuid , ) -> Result < AccountWithEncryptedTokens , NodeStoreError > { let encrypted = self . redis_get_account ( id ) . await ? ; let account = & encrypted . account ; let mut pipe = redis_crate :: pipe ( ) ; pipe . atomic ( ) ; pipe . srem ( & * prefixed_key ( & self . db_prefix , ACCOUNTS_KEY ) , RedisAccountId ( account . id ) , ) . ignore ( ) ; pipe . del ( & * accounts_key ( & self . db_prefix , account . id ) ) . ignore ( ) ; pipe . hdel ( & * prefixed_key ( & self . db_prefix , USERNAMES_KEY ) , account . username ( ) . as_ref ( ) , ) . ignore ( ) ; if account . should_send_routes ( ) { pipe . srem ( & * prefixed_key ( & self . db_prefix , SEND_ROUTES_KEY ) , RedisAccountId ( account . id ) , ) . ignore ( ) ; } if account . should_receive_routes ( ) { pipe . srem ( & * prefixed_key ( & self . db_prefix , RECEIVE_ROUTES_FROM_KEY ) , RedisAccountId ( account . id ) , ) . ignore ( ) ; } if account . ilp_over_btp_url . is_some ( ) { pipe . srem ( & * prefixed_key ( & self . db_prefix , BPT_OUTGOING ) , RedisAccountId ( account . id ) , ) . ignore ( ) ; } pipe . hdel ( & * prefixed_key ( & self . db_prefix , ROUTES_KEY ) , account . ilp_address . to_bytes ( ) . to_vec ( ) , ) . ignore ( ) ; pipe . del ( uncredited_amount_key ( & self . db_prefix , id ) ) ; let mut connection = self . connection . clone ( ) ; pipe . query_async ( & mut connection ) . await ? ; update_routes ( connection , self . routes . clone ( ) , & self . db_prefix ) . await ? ; debug ! ( " " account id ) ; Ok ( encrypted ) }
Deletes the account corresponding to the provided `id` from Redis.
Deletes the account corresponding to the provided ` id ` from Redis .
&self
id
Uuid