use compact_encoding::{EncodingError, FixedWidthEncoding, as_array, to_encoded_bytes};
const TREE: [u8; 32] = [
0x9F, 0xAC, 0x70, 0xB5, 0xC, 0xA1, 0x4E, 0xFC, 0x4E, 0x91, 0xC8, 0x33, 0xB2, 0x4, 0xE7, 0x5B,
0x8B, 0x5A, 0xAD, 0x8B, 0x58, 0x81, 0xBF, 0xC0, 0xAD, 0xB5, 0xEF, 0x38, 0xA3, 0x27, 0x5B, 0x9C,
];
pub(crate) fn signable_tree(hash: &[u8], length: u64, fork: u64) -> Box<[u8]> {
(|| {
Ok::<_, EncodingError>(to_encoded_bytes!(
&TREE,
as_array::<32>(hash)?,
length.as_fixed_width(),
fork.as_fixed_width()
))
})()
.expect("Encoding should not fail")
}