We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49c52df commit 20f61b2Copy full SHA for 20f61b2
stackslib/src/chainstate/burn/mod.rs
@@ -158,17 +158,9 @@ impl SortitionHash {
158
159
/// Convert a SortitionHash into a (little-endian) uint256
160
pub fn to_uint256(&self) -> Uint256 {
161
- let chunks = self.0.chunks_exact(8);
162
- let remainder = chunks.remainder();
163
-
164
- let u64_chunks: Vec<[u8; 8]> = chunks
165
- .map(|chunk| chunk.try_into().expect("chunk size should be 8"))
166
- .collect();
167
168
- assert!(
169
- remainder.is_empty(),
170
- "SortitionHash was not evenly divisible by 8"
171
- );
+ let (u64_chunks, []) = self.0.as_chunks::<8>() else {
+ panic!("SortitionHash was not evenly divisible by 8")
+ };
172
173
let tmp: Vec<u64> = u64_chunks
174
.iter()
0 commit comments