Adjust AccountId20 detection with partial match (#5605)

This commit is contained in:
Jaco
2023-04-22 11:48:59 +03:00
committed by GitHub
parent 83500c05b3
commit 3b894da9f2
2 changed files with 5 additions and 5 deletions
@@ -418,11 +418,10 @@ function registerTypes (lookup: PortableRegistry, lookups: Record<string, string
}
lookup.registry.register({
AccountId: ['sp_core::crypto::AccountId32'].includes(nsAccountId)
? 'AccountId32'
: ['account::AccountId20', 'primitive_types::H160'].includes(nsAccountId)
? 'AccountId20'
: 'AccountId32', // other, default to AccountId32
// known: account::AccountId20, fp_account::AccountId20, primitive_types::H160
AccountId: nsAccountId.endsWith('::AccountId20') || nsAccountId.endsWith('::H160')
? 'AccountId20'
: 'AccountId32',
Address: isMultiAddress
? 'MultiAddress'
: 'AccountId',