mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
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:
@@ -64,8 +64,7 @@ pub mod pallet {
|
||||
+ MaybeSerializeDeserialize
|
||||
+ Debug
|
||||
+ MaybeDisplay
|
||||
+ Ord
|
||||
+ Default;
|
||||
+ Ord;
|
||||
/// Type of account public key on target chain.
|
||||
type TargetChainAccountPublic: Parameter + IdentifyAccount<AccountId = Self::AccountId>;
|
||||
/// Type of signature that may prove that the message has been signed by
|
||||
|
||||
@@ -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 {}",
|
||||
|
||||
@@ -82,13 +82,8 @@ pub trait Chain: Send + Sync + 'static {
|
||||
+ MaybeSerializeDeserialize;
|
||||
|
||||
/// The user account identifier type for the runtime.
|
||||
type AccountId: Parameter
|
||||
+ Member
|
||||
+ MaybeSerializeDeserialize
|
||||
+ Debug
|
||||
+ MaybeDisplay
|
||||
+ Ord
|
||||
+ Default;
|
||||
type AccountId: Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + Ord;
|
||||
|
||||
/// Balance of an account in native tokens.
|
||||
///
|
||||
/// The chain may support multiple tokens, but this particular type is for token that is used
|
||||
|
||||
Reference in New Issue
Block a user