Skip to content

replace use of bitcoin::utils::misc::hex_bytes with hex::decode #95

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

Merged
merged 2 commits into from
Jul 28, 2018
Merged

replace use of bitcoin::utils::misc::hex_bytes with hex::decode #95

merged 2 commits into from
Jul 28, 2018

Conversation

savil
Copy link
Contributor

@savil savil commented Jul 28, 2018

as requested in #84 discussion
#84 (comment)

@TheBlueMatt
Copy link
Collaborator

Thanks! Also in fuzz/fuzz_targets. If you're gonna change every line anyway why not just write out "hex::decode"? Otherwise just import it as hex_bytes so you dont have to change every line.

@savil
Copy link
Contributor Author

savil commented Jul 28, 2018

ah, yeah, forgot about fuzz directory. will do, hold on.

hmm - I guess, I was trying to match the existing code style of importing on top. I can change to ::hex::decode no problem.

Slight preference to avoid hex_bytes because then when reading code some files will say hex_decode/::hex::decode and some hex_bytes, and newbies will have to lookup the import line to realize they are the same things. Not a big deal, but a minor cognitive dissonance.

@savil
Copy link
Contributor Author

savil commented Jul 28, 2018

in fuzz/, what did you have in mind? git grep "hex_bytes" has no results.

@TheBlueMatt
Copy link
Collaborator

In fuzz there's a bunch of extend_vec_from_hex's that could get replaced. import hex; and hex::decode seems good to me, or ::hex::decode, though I find that less readable.

@savil
Copy link
Contributor Author

savil commented Jul 28, 2018 via email

@savil
Copy link
Contributor Author

savil commented Jul 28, 2018

fresh code is in. Lets hope it passes the travis/fuzz testing.

lightning = { path = "..", features = ["fuzztarget"] }
bitcoin = { version = "0.13", features = ["fuzztarget"] }
secp256k1 = { version = "0.9", features=["fuzztarget"] }
rust-crypto = "0.2"
hex = "0.3.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think usually its best to just specify 0.3, as minor bumps we'd want to take as bugfixes, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair point!

@TheBlueMatt TheBlueMatt merged commit 982317a into lightningdevkit:master Jul 28, 2018
@savil savil deleted the rm-bitcoin-util-hexbytes branch July 30, 2018 23:11
carlaKC pushed a commit to carlaKC/rust-lightning that referenced this pull request Aug 9, 2023
…artupargs

Prompt user to provide at least 2 arguments rather than 3
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.

2 participants