Skip to content

Commit

Permalink
feat(cdk_sdk):remove spent proof and update db state (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
mubarak23 authored Oct 11, 2024
1 parent 260f262 commit ef3ecce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/cdk/src/wallet/proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ impl Wallet {
.collect::<Result<Vec<PublicKey>, _>>()?,
)
.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)
}
Expand Down

0 comments on commit ef3ecce

Please sign in to comment.