mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-23 02:49:57 +00:00
# Description Adds Snowbridge to the Rococo bridge hub runtime. Includes config changes required in Rococo asset hub. --------- Co-authored-by: Alistair Singh <alistair.singh7@gmail.com> Co-authored-by: ron <yrong1997@gmail.com> Co-authored-by: Vincent Geddes <vincent.geddes@hey.com> Co-authored-by: claravanstaden <Cats 4 life!>
20 lines
593 B
Rust
20 lines
593 B
Rust
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-FileCopyrightText: 2023 Snowfork <hello@snowfork.com>
|
|
use sp_std::{convert::TryInto, prelude::*};
|
|
use ssz_rs::{Bitvector, Deserialize};
|
|
|
|
pub fn decompress_sync_committee_bits<
|
|
const SYNC_COMMITTEE_SIZE: usize,
|
|
const SYNC_COMMITTEE_BITS_SIZE: usize,
|
|
>(
|
|
input: [u8; SYNC_COMMITTEE_BITS_SIZE],
|
|
) -> [u8; SYNC_COMMITTEE_SIZE] {
|
|
Bitvector::<{ SYNC_COMMITTEE_SIZE }>::deserialize(&input)
|
|
.expect("checked statically; qed")
|
|
.iter()
|
|
.map(|bit| u8::from(bit == true))
|
|
.collect::<Vec<u8>>()
|
|
.try_into()
|
|
.expect("checked statically; qed")
|
|
}
|