Fix .at queries/decoration for pre-V13 metadata (#4000)
* Fix `.at` queries/decoration for pre-V13 metadata * fields fix (or rather... protection against upcoming change)
This commit is contained in:
@@ -418,7 +418,7 @@ export class GenericPortableRegistry extends Struct {
|
||||
} else if (path.length && path[path.length - 1].toString() === 'WrapperOpaque') {
|
||||
return withTypeString(this.registry, {
|
||||
info: TypeDefInfo.WrapperOpaque,
|
||||
sub: this.#createSiDef(fields[0].type)
|
||||
sub: this.#createSiDef(params[0].type.unwrap())
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ export function expandMetadata (registry: Registry, metadata: Metadata): Decorat
|
||||
errors: decorateErrors(registry, latest, version),
|
||||
events: decorateEvents(registry, latest, version),
|
||||
query: decorateStorage(registry, latest, version),
|
||||
registry,
|
||||
tx: decorateExtrinsics(registry, latest, version)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { DispatchErrorModule, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces';
|
||||
import type { StorageEntry } from '../../primitive/types';
|
||||
import type { AnyTuple, CallFunction, Codec, IEvent } from '../../types';
|
||||
import type { AnyTuple, CallFunction, Codec, IEvent, Registry } from '../../types';
|
||||
|
||||
export interface ConstantCodec extends Codec {
|
||||
readonly meta: PalletConstantMetadataLatest;
|
||||
@@ -46,5 +46,6 @@ export interface DecoratedMeta {
|
||||
readonly errors: Errors;
|
||||
readonly events: Events;
|
||||
readonly query: Storage;
|
||||
readonly registry: Registry;
|
||||
readonly tx: Extrinsics
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user