Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Lift dependencies up to top of file, remove redundant secp/zkp libraries #234

Closed
wants to merge 1 commit into from

Conversation

Kodylow
Copy link
Member

@Kodylow Kodylow commented Jul 9, 2022

Went through and cleaned up some of our dependency usage, lifting as much as I could up into the use statements. In the process I standardized to using the keys in bitcoin::secp256k1::{PublicKey, XOnlyPublicKey}, if we use bitcoin::PublicKey for example then we have to import the bitcoin crate wherever we want to use it instead of just pulling in secp. The only crate that strictly requires using bitcoin::PublicKey right now is miniscript so in the wallet we can convert from the secp -> bitcoin::PublicKey using kp.to_public_key()

Also was able to remove secp256k1-zkp from client-lib, minimint-api, and minimint Cargo.tomls. All the functions and structs they were using have been integrated into secp256k1. I also removed secp256k1 as a dependency where we already were using the bitcoin crate.

lifted dependencies in minimint and gateway, standardized to bitcoin::secp256k1::{XOnlyPublicKey, PublicKey} except where we touch miniscript

finished lifting dependencies, removed zkp from 2 modules
@@ -8,14 +8,13 @@ edition = "2018"
[dependencies]
anyhow = "1.0.58"
async-trait = "0.1"
bitcoin = { version = "0.28.1", features = [ "rand", "serde" ] }
bitcoin = { version = "0.28.1", features = [ "rand", "serde", "use-serde"] }
Copy link
Member

Choose a reason for hiding this comment

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

you can remove "serde" because use-serde enables that

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI use-serde is being renamed to serde in the next release rust-bitcoin/rust-bitcoin#1006

@justinmoon
Copy link
Contributor

LGTM. This makes code more readable IMO.

@justinmoon
Copy link
Contributor

I apologize for sending you to rebase hell, Kody :(

@Kodylow
Copy link
Member Author

Kodylow commented Jul 13, 2022

@justinmoon it's a learning exercise haha

@justinmoon
Copy link
Contributor

Going to close this since the rebase will be impossible. Feel free to re-open. Will try to get faster review next time.

@justinmoon justinmoon closed this Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants