Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

mubarak23
Copy link
Contributor

PR For issue: #353
This PR add spent proof pub keys as the second params in update_proofs function,
i figure out since the update proof function do two thing

  • remove spent proof
  • add unspent proof,

instead of creating another function that collect spent proof and remove them, i filter through the proofs and collect the spent proof pub key and add it as the second params that update_proofs

crates/cdk/src/wallet/mod.rs Outdated Show resolved Hide resolved
crates/cdk/src/wallet/mod.rs Outdated Show resolved Hide resolved
@mubarak23 mubarak23 requested a review from thesimplekid October 8, 2024 07:51
@mubarak23
Copy link
Contributor Author

@thesimplekid do you have time review this

Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

        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?;

This needs to be added to the check_proofs_spent fn as mentioned in the issue not the restore fn. The restore fn does not need to be changed

@mubarak23
Copy link
Contributor Author

check_proofs_spent

i understand

Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the fmt error then rebase and squash the commits

@mubarak23
Copy link
Contributor Author

mubarak23 commented Oct 11, 2024

Can you fix the fmt error then rebase and squash the commits

i dont think there is a need for a rebase, my fork repo is up to date with main branch.

will fix the fmt error

@mubarak23
Copy link
Contributor Author

@thesimplekid watch your workshop session via youtube at bitcoinplusplus, will you push the implementation on github repo

@thesimplekid
Copy link
Collaborator

@thesimplekid watch your workshop session via youtube at bitcoinplusplus, will you push the implementation on github repo

Sure its here thesimplekid/btcpp_cdk_wallet#1 by the way there is a cdk channel in the cashu discord that can be used for more general chats
https://discordapp.com/channels/1182354492868538449/1225868484806705174

@thesimplekid thesimplekid merged commit ef3ecce into cashubtc:main Oct 11, 2024
42 checks passed
@mubarak23
Copy link
Contributor Author

@thesimplekid watch your workshop session via youtube at bitcoinplusplus, will you push the implementation on github repo

Sure its here thesimplekid/btcpp_cdk_wallet#1 by the way there is a cdk channel in the cashu discord that can be used for more general chats https://discordapp.com/channels/1182354492868538449/1225868484806705174

the discord link is failing, can you drop the invite link

@thesimplekid
Copy link
Collaborator

https://discord.gg/HXN8ep79

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants