Use array-bytes for array/bytes/hex operations#695
Use array-bytes for array/bytes/hex operations#695aurexav wants to merge 4 commits intoparitytech:masterfrom
array-bytes for array/bytes/hex operations#695Conversation
| } | ||
| Ok(result) | ||
| fn from_str(input: &str) -> $crate::core_::result::Result<$name, $crate::array_bytes::Error> { | ||
| $crate::array_bytes::hex_n_into::<Self, { Self::len_bytes() }>(input) |
There was a problem hiding this comment.
As you can see, it has some really friendly APIs.
And it will handle the "0x" prefix and errors.
acatangiu
left a comment
There was a problem hiding this comment.
Looks ok to me, but it is incomplete (good to merge once it passes CI)
Fixed. And it looks like there are some new errors in your CI script. |
|
And I made some algorithm optimization these days. Check the benchmark results here. Not only it has blockchain-developer-friendly API. I think it's also |
|
Hi! Any plan for this? |
|
Can you resolve the merge conflict? |
ordian
left a comment
There was a problem hiding this comment.
I've taken a look before and remained unconvinced.
One of the benefits advertized:
And it's completely no-std.
We could also use rustc-hex without it's std feature and call it completely no-std this way.
By switfly looking at https://github.com/hack-ink/array-bytes/blob/main/src/lib.rs I see a few problems:
- It's using unidiomatic function naming: https://rust-lang.github.io/api-guidelines/naming.html
- Unwraps and safe
uncheckedmethods. - It's not audited.
So what's the benefit, really?
| Some(&self.inner) | ||
| // Some(&self.inner) | ||
| // TODO: <https://github.com/rust-lang/project-error-handling/issues/3> | ||
| None |
For me, I want to bring these to other blockchain developers. It's really an honor and a good example to be a part of the parity-common (one of the most frequently used blockchain library). Would you consider this? |
Reasons: paritytech/substrate#12111
Substrate PR: paritytech/substrate#12190