feat(cdk_sdk):remove spent proof and update db state (#393)

This commit is contained in:
Mubarak Muhammad Aminu
2024-10-11 17:02:53 +01:00
committed by GitHub
parent 260f262c39
commit ef3ecce3cf

View File

@@ -111,6 +111,16 @@ impl Wallet {
.collect::<Result<Vec<PublicKey>, _>>()?, .collect::<Result<Vec<PublicKey>, _>>()?,
) )
.await?; .await?;
let spent_ys: Vec<_> = spendable
.states
.iter()
.filter_map(|p| match p.state {
State::Spent => Some(p.y),
_ => None,
})
.collect();
self.localstore.update_proofs(vec![], spent_ys).await?;
Ok(spendable.states) Ok(spendable.states)
} }