typegen: keep array and null inputs for types that contain an account

getSimilarTypes widened lookup types by name before its class checks, with
type.includes('AccountId32') and type.includes('MultiAddress'). Those also
match every type that only contains one: Vec<AccountId32>,
Option<AccountId32>, ITuple<[AccountId32, u32]>, Vec<MultiAddress>. They
were widened like a bare account and returned before reaching the Vec,
Option or Tuple branch, so the generated augment typed
multisig.asMulti(otherSignatories) as `Vec<AccountId32> | string |
Uint8Array` (no string[]), an Option<AccountId32> argument without null,
and a tuple key without its tuple form.

The names are now matched whole. The augment is regenerated
(yarn build:metadata); for these types it now matches what upstream
generates, e.g. `Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]`.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-10-08 22:56:57 +04:00
1 parent 2a358917c7
commit 9caac8b0d4
12 files changed
+157 -138

No files matched your search

+2 -2
View File
@@ -47,7 +47,7 @@ declare module '@pezkuwi/api-base/types/storage' {
* Amounts currently reserved in the accounts of the bidders currently winning
* (sub-)ranges.
**/
reservedAmounts: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | string | Uint8Array) => Observable<Option<u128>>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
reservedAmounts: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | [AccountId32 | string | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<Option<u128>>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
/**
* The winning bids for each of the 10 ranges at each sample in the final Ending Period of
* the current auction. The map's key is the 0-based index into the Sample Size. The
@@ -2089,7 +2089,7 @@ declare module '@pezkuwi/api-base/types/storage' {
* Records information about the maximum slash of a stash within a slashing span,
* as well as how much reward has been paid out.
**/
spanSlash: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | string | Uint8Array) => Observable<PezpalletStakingSlashingSpanRecord>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
spanSlash: AugmentedQuery<ApiType, (arg: ITuple<[AccountId32, u32]> | [AccountId32 | string | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<PezpalletStakingSlashingSpanRecord>, [ITuple<[AccountId32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[AccountId32, u32]>]>;
/**
* All unapplied slashes that are queued for later.
**/