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
@@ -409,11 +409,13 @@ pub fn account_info_storage_key(id: &AccountId) -> Vec<u8> {
#[cfg(test)]
mod tests {
use super::*;
use sp_runtime::codec::Encode;
use parity_scale_codec::Decode;
use sp_runtime::{codec::Encode, traits::TrailingZeroInput};
#[test]
fn maximal_encoded_account_id_size_is_correct() {
let actual_size = AccountId::default().encode().len();
let actual_size =
AccountId::decode(&mut TrailingZeroInput::new(&[])).unwrap().encode().len();
assert!(
actual_size <= MAXIMAL_ENCODED_ACCOUNT_ID_SIZE as usize,
"Actual size of encoded account id for Polkadot-like chains ({}) is larger than expected {}",