|
@@ -287,19 +287,21 @@ impl AuthWallet {
|
|
|
#[instrument(skip(self))]
|
|
#[instrument(skip(self))]
|
|
|
pub async fn get_blind_auth_token(&self) -> Result<Option<BlindAuthToken>, Error> {
|
|
pub async fn get_blind_auth_token(&self) -> Result<Option<BlindAuthToken>, Error> {
|
|
|
let mut tx = self.localstore.begin_db_transaction().await?;
|
|
let mut tx = self.localstore.begin_db_transaction().await?;
|
|
|
- let unspent = tx
|
|
|
|
|
|
|
+
|
|
|
|
|
+ let auth_proof = match tx
|
|
|
.get_proofs(
|
|
.get_proofs(
|
|
|
Some(self.mint_url.clone()),
|
|
Some(self.mint_url.clone()),
|
|
|
Some(CurrencyUnit::Auth),
|
|
Some(CurrencyUnit::Auth),
|
|
|
Some(vec![State::Unspent]),
|
|
Some(vec![State::Unspent]),
|
|
|
None,
|
|
None,
|
|
|
)
|
|
)
|
|
|
- .await?;
|
|
|
|
|
-
|
|
|
|
|
- let auth_proof = match unspent.first() {
|
|
|
|
|
|
|
+ .await?
|
|
|
|
|
+ .pop()
|
|
|
|
|
+ {
|
|
|
Some(proof) => {
|
|
Some(proof) => {
|
|
|
tx.update_proofs(vec![], vec![proof.proof.y()?]).await?;
|
|
tx.update_proofs(vec![], vec![proof.proof.y()?]).await?;
|
|
|
- proof.proof.clone().try_into()?
|
|
|
|
|
|
|
+ tx.commit().await?;
|
|
|
|
|
+ proof.proof.try_into()?
|
|
|
}
|
|
}
|
|
|
None => return Ok(None),
|
|
None => return Ok(None),
|
|
|
};
|
|
};
|