Companion for Substrate#10655 (#4765)

* Companion for Substrate#10655

https://github.com/paritytech/substrate/pull/10655

This removes the last usages of `Default` in conjunction with `AccountId`

* More fixes

* More of them!

* FMT

* Update Substrate
This commit is contained in:
Bastian Köcher
2022-01-21 21:14:09 +01:00
committed by GitHub
parent cc1201ef27
commit ef13a0ab8d
6 changed files with 176 additions and 179 deletions
+2 -2
View File
@@ -305,11 +305,11 @@ impl<'a> parity_scale_codec::Input for TrailingZeroInput<'a> {
/// Format is b"para" ++ encode(parachain ID) ++ 00.... where 00... is indefinite trailing
/// zeroes to fill [`AccountId`].
impl<T: Encode + Decode + Default> AccountIdConversion<T> for Id {
impl<T: Encode + Decode> AccountIdConversion<T> for Id {
fn into_account(&self) -> T {
(b"para", self)
.using_encoded(|b| T::decode(&mut TrailingZeroInput(b)))
.unwrap_or_default()
.expect("infinite length input; no invalid inputs for type; qed")
}
fn try_from_account(x: &T) -> Option<Self> {