Remove as unknown (#1636)
* Remove some as unknowns * Rename sanitize * Remove file
This commit is contained in:
committed by
Jaco Greeff
parent
b7ba654e48
commit
f78bf9dde1
@@ -199,10 +199,10 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
|
||||
}
|
||||
|
||||
return section;
|
||||
}, {} as unknown as DecoratedRpcSection<ApiType, RpcInterface[typeof sectionName]>);
|
||||
}, {} as DecoratedRpcSection<ApiType, RpcInterface[typeof sectionName]>);
|
||||
|
||||
return out;
|
||||
}, {} as unknown as DecoratedRpc<ApiType, RpcInterface>);
|
||||
}, {} as DecoratedRpc<ApiType, RpcInterface>);
|
||||
}
|
||||
|
||||
protected decorateMulti<ApiType extends ApiTypes> (decorateMethod: DecorateMethod<ApiType>): QueryableStorageMulti<ApiType> {
|
||||
@@ -223,10 +223,10 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
|
||||
out[name] = this.decorateExtrinsicEntry(method, creator);
|
||||
|
||||
return out;
|
||||
}, {} as unknown as SubmittableModuleExtrinsics<ApiType>);
|
||||
}, {} as SubmittableModuleExtrinsics<ApiType>);
|
||||
|
||||
return out;
|
||||
}, creator as unknown as SubmittableExtrinsics<ApiType>);
|
||||
}, creator as SubmittableExtrinsics<ApiType>);
|
||||
}
|
||||
|
||||
private decorateExtrinsicEntry<ApiType extends ApiTypes> (method: CallFunction, creator: (value: Call | Uint8Array | string) => SubmittableExtrinsic<ApiType>): SubmittableExtrinsicFunction<ApiType> {
|
||||
@@ -242,10 +242,10 @@ export default abstract class Decorate<ApiType extends ApiTypes> extends Events
|
||||
out[name] = this.decorateStorageEntry(method, decorateMethod);
|
||||
|
||||
return out;
|
||||
}, {} as unknown as QueryableModuleStorage<ApiType>);
|
||||
}, {} as QueryableModuleStorage<ApiType>);
|
||||
|
||||
return out;
|
||||
}, {} as unknown as QueryableStorage<ApiType>);
|
||||
}, {} as QueryableStorage<ApiType>);
|
||||
}
|
||||
|
||||
private decorateStorageEntry<ApiType extends ApiTypes> (creator: StorageEntry, decorateMethod: DecorateMethod<ApiType>): QueryableStorageEntry<ApiType> {
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('ApiPromise', (): void => {
|
||||
const metadata: any = {};
|
||||
const key = `${genesisHash}-${specVersion}`;
|
||||
metadata[key] = rpcData;
|
||||
const api = await ApiPromise.create({ provider, metadata, registry } as unknown as ApiOptions);
|
||||
const api = await ApiPromise.create({ provider, metadata, registry } as ApiOptions);
|
||||
|
||||
expect(api.genesisHash).toBeDefined();
|
||||
expect(api.runtimeMetadata).toBeDefined();
|
||||
|
||||
@@ -174,7 +174,7 @@ export default function createClass <ApiType extends ApiTypes> ({ api, apiType,
|
||||
genesisHash: this._api.genesisHash,
|
||||
runtimeVersion: this._api.runtimeVersion,
|
||||
version: this._api.extrinsicType
|
||||
} as unknown as SignatureOptions;
|
||||
} as SignatureOptions;
|
||||
}
|
||||
|
||||
private _makeEraOptions (options: Partial<SignerOptions>, { header, nonce }: { header: Header | null; nonce: Index }): SignatureOptions {
|
||||
|
||||
Reference in New Issue
Block a user