mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 05:35:42 +00:00
v3::Junction supports small (32-byte max) "vecs". (#6716)
* v3::Junction supports small (32-byte max) "vecs". * Formatting * Add test
This commit is contained in:
@@ -92,11 +92,11 @@ impl TryFrom<NewJunction> for Junction {
|
||||
Self::AccountKey20 { network: network.try_into()?, key },
|
||||
PalletInstance(index) => Self::PalletInstance(index),
|
||||
GeneralIndex(id) => Self::GeneralIndex(id),
|
||||
GeneralKey(key) => Self::GeneralKey(
|
||||
key[..]
|
||||
GeneralKey { length, data } => Self::GeneralKey(
|
||||
data[0..data.len().min(length as usize)]
|
||||
.to_vec()
|
||||
.try_into()
|
||||
.expect("array is of size 32 and so will never be out of bounds; qed"),
|
||||
.expect("key is bounded to 32 and so will never be out of bounds; qed"),
|
||||
),
|
||||
OnlyChild => Self::OnlyChild,
|
||||
Plurality { id, part } => Self::Plurality { id: id.into(), part: part.into() },
|
||||
|
||||
Reference in New Issue
Block a user