Enable noImplicitOverride and adapt code

This commit is contained in:
Simon Warta 2021-07-20 15:20:34 +02:00
parent d00e08e4a4
commit 80d75d79db
8 changed files with 17 additions and 16 deletions

View File

@ -20,7 +20,7 @@ export class Cw1CosmWasmClient extends SigningCosmWasmClient {
this.cw1ContractAddress = cw1ContractAddress; this.cw1ContractAddress = cw1ContractAddress;
} }
public async getAccount(address?: string): Promise<Account | undefined> { public override async getAccount(address?: string): Promise<Account | undefined> {
return super.getAccount(address || this.cw1ContractAddress); return super.getAccount(address || this.cw1ContractAddress);
} }

View File

@ -84,7 +84,7 @@ export class Cw3CosmWasmClient extends SigningCosmWasmClient {
this.cw3ContractAddress = cw3ContractAddress; this.cw3ContractAddress = cw3ContractAddress;
} }
public getAccount(address?: string): Promise<Account | undefined> { public override getAccount(address?: string): Promise<Account | undefined> {
return super.getAccount(address || this.cw3ContractAddress); return super.getAccount(address || this.cw3ContractAddress);
} }

View File

@ -184,11 +184,11 @@ export class SigningCosmWasmClient extends CosmWasmClient {
this.fees = buildFeeTable<CosmWasmFeeTable>(gasPrice, defaultGasLimits, gasLimits); this.fees = buildFeeTable<CosmWasmFeeTable>(gasPrice, defaultGasLimits, gasLimits);
} }
public async getSequence(address?: string): Promise<GetSequenceResult> { public override async getSequence(address?: string): Promise<GetSequenceResult> {
return super.getSequence(address || this.signerAddress); return super.getSequence(address || this.signerAddress);
} }
public async getAccount(address?: string): Promise<Account | undefined> { public override async getAccount(address?: string): Promise<Account | undefined> {
return super.getAccount(address || this.signerAddress); return super.getAccount(address || this.signerAddress);
} }

View File

@ -204,7 +204,7 @@ export async function makeWasmClient(
* A class for testing clients using an Amino signer which modifies the transaction it receives before signing * A class for testing clients using an Amino signer which modifies the transaction it receives before signing
*/ */
export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet { export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
public static async fromMnemonic( public static override async fromMnemonic(
mnemonic: string, mnemonic: string,
options: Partial<Secp256k1HdWalletOptions> = {}, options: Partial<Secp256k1HdWalletOptions> = {},
): Promise<ModifyingSecp256k1HdWallet> { ): Promise<ModifyingSecp256k1HdWallet> {
@ -213,7 +213,7 @@ export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
return new ModifyingSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed }); return new ModifyingSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed });
} }
public async signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse> { public override async signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse> {
const modifiedSignDoc = { const modifiedSignDoc = {
...signDoc, ...signDoc,
fee: { fee: {
@ -230,7 +230,7 @@ export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
* A class for testing clients using a direct signer which modifies the transaction it receives before signing * A class for testing clients using a direct signer which modifies the transaction it receives before signing
*/ */
export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet { export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
public static async fromMnemonic( public static override async fromMnemonic(
mnemonic: string, mnemonic: string,
options: Partial<DirectSecp256k1HdWalletOptions> = {}, options: Partial<DirectSecp256k1HdWalletOptions> = {},
): Promise<DirectSecp256k1HdWallet> { ): Promise<DirectSecp256k1HdWallet> {
@ -239,7 +239,7 @@ export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
return new ModifyingDirectSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed }); return new ModifyingDirectSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed });
} }
public async signDirect(address: string, signDoc: SignDoc): Promise<DirectSignResponse> { public override async signDirect(address: string, signDoc: SignDoc): Promise<DirectSignResponse> {
const txBody = TxBody.decode(signDoc.bodyBytes); const txBody = TxBody.decode(signDoc.bodyBytes);
const modifiedTxBody = TxBody.fromPartial({ const modifiedTxBody = TxBody.fromPartial({
...txBody, ...txBody,

View File

@ -145,7 +145,7 @@ export class ExtendedSecp256k1Signature extends Secp256k1Signature {
* Decode extended signature from the simple fixed length encoding * Decode extended signature from the simple fixed length encoding
* described in toFixedLength(). * described in toFixedLength().
*/ */
public static fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature { public static override fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature {
if (data.length !== 65) { if (data.length !== 65) {
throw new Error(`Got invalid data length ${data.length}. Expected 32 + 32 + 1`); throw new Error(`Got invalid data length ${data.length}. Expected 32 + 32 + 1`);
} }
@ -177,7 +177,7 @@ export class ExtendedSecp256k1Signature extends Secp256k1Signature {
* r (32 bytes) | s (32 bytes) | recovery param (1 byte) * r (32 bytes) | s (32 bytes) | recovery param (1 byte)
* where | denotes concatenation of bonary data. * where | denotes concatenation of bonary data.
*/ */
public toFixedLength(): Uint8Array { public override toFixedLength(): Uint8Array {
return new Uint8Array([...this.r(32), ...this.s(32), this.recovery]); return new Uint8Array([...this.r(32), ...this.s(32), this.recovery]);
} }
} }

View File

@ -57,11 +57,11 @@ export class SigningCosmosClient extends CosmosClient {
this.fees = buildFeeTable<CosmosFeeTable>(gasPrice, defaultGasLimits, gasLimits); this.fees = buildFeeTable<CosmosFeeTable>(gasPrice, defaultGasLimits, gasLimits);
} }
public async getSequence(address?: string): Promise<GetSequenceResult> { public override async getSequence(address?: string): Promise<GetSequenceResult> {
return super.getSequence(address || this.signerAddress); return super.getSequence(address || this.signerAddress);
} }
public async getAccount(address?: string): Promise<Account | undefined> { public override async getAccount(address?: string): Promise<Account | undefined> {
return super.getAccount(address || this.signerAddress); return super.getAccount(address || this.signerAddress);
} }

View File

@ -157,7 +157,7 @@ export const tendermintIdMatcher = /^[0-9A-F]{64}$/;
* A class for testing clients using an Amino signer which modifies the transaction it receives before signing * A class for testing clients using an Amino signer which modifies the transaction it receives before signing
*/ */
export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet { export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
public static async fromMnemonic( public static override async fromMnemonic(
mnemonic: string, mnemonic: string,
options: Partial<Secp256k1HdWalletOptions> = {}, options: Partial<Secp256k1HdWalletOptions> = {},
): Promise<ModifyingSecp256k1HdWallet> { ): Promise<ModifyingSecp256k1HdWallet> {
@ -166,7 +166,7 @@ export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
return new ModifyingSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed }); return new ModifyingSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed });
} }
public async signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse> { public override async signAmino(signerAddress: string, signDoc: StdSignDoc): Promise<AminoSignResponse> {
const modifiedSignDoc = { const modifiedSignDoc = {
...signDoc, ...signDoc,
fee: { fee: {
@ -183,7 +183,7 @@ export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
* A class for testing clients using a direct signer which modifies the transaction it receives before signing * A class for testing clients using a direct signer which modifies the transaction it receives before signing
*/ */
export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet { export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
public static async fromMnemonic( public static override async fromMnemonic(
mnemonic: string, mnemonic: string,
options: Partial<DirectSecp256k1HdWalletOptions> = {}, options: Partial<DirectSecp256k1HdWalletOptions> = {},
): Promise<DirectSecp256k1HdWallet> { ): Promise<DirectSecp256k1HdWallet> {
@ -192,7 +192,7 @@ export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
return new ModifyingDirectSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed }); return new ModifyingDirectSecp256k1HdWallet(mnemonicChecked, { ...options, seed: seed });
} }
public async signDirect(address: string, signDoc: SignDoc): Promise<DirectSignResponse> { public override async signDirect(address: string, signDoc: SignDoc): Promise<DirectSignResponse> {
const txBody = TxBody.decode(signDoc.bodyBytes); const txBody = TxBody.decode(signDoc.bodyBytes);
const modifiedTxBody = TxBody.fromPartial({ const modifiedTxBody = TxBody.fromPartial({
...txBody, ...txBody,

View File

@ -11,6 +11,7 @@
"noEmitOnError": true, "noEmitOnError": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"noImplicitOverride": true,
"noUnusedLocals": false, "noUnusedLocals": false,
"noUnusedParameters": false, "noUnusedParameters": false,
"pretty": true, "pretty": true,