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;
}
public async getAccount(address?: string): Promise<Account | undefined> {
public override async getAccount(address?: string): Promise<Account | undefined> {
return super.getAccount(address || this.cw1ContractAddress);
}

View File

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

View File

@ -184,11 +184,11 @@ export class SigningCosmWasmClient extends CosmWasmClient {
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);
}
public async getAccount(address?: string): Promise<Account | undefined> {
public override async getAccount(address?: string): Promise<Account | undefined> {
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
*/
export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
public static async fromMnemonic(
public static override async fromMnemonic(
mnemonic: string,
options: Partial<Secp256k1HdWalletOptions> = {},
): Promise<ModifyingSecp256k1HdWallet> {
@ -213,7 +213,7 @@ export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
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 = {
...signDoc,
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
*/
export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
public static async fromMnemonic(
public static override async fromMnemonic(
mnemonic: string,
options: Partial<DirectSecp256k1HdWalletOptions> = {},
): Promise<DirectSecp256k1HdWallet> {
@ -239,7 +239,7 @@ export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
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 modifiedTxBody = TxBody.fromPartial({
...txBody,

View File

@ -145,7 +145,7 @@ export class ExtendedSecp256k1Signature extends Secp256k1Signature {
* Decode extended signature from the simple fixed length encoding
* described in toFixedLength().
*/
public static fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature {
public static override fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature {
if (data.length !== 65) {
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)
* where | denotes concatenation of bonary data.
*/
public toFixedLength(): Uint8Array {
public override toFixedLength(): Uint8Array {
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);
}
public async getSequence(address?: string): Promise<GetSequenceResult> {
public override async getSequence(address?: string): Promise<GetSequenceResult> {
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);
}

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
*/
export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
public static async fromMnemonic(
public static override async fromMnemonic(
mnemonic: string,
options: Partial<Secp256k1HdWalletOptions> = {},
): Promise<ModifyingSecp256k1HdWallet> {
@ -166,7 +166,7 @@ export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
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 = {
...signDoc,
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
*/
export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
public static async fromMnemonic(
public static override async fromMnemonic(
mnemonic: string,
options: Partial<DirectSecp256k1HdWalletOptions> = {},
): Promise<DirectSecp256k1HdWallet> {
@ -192,7 +192,7 @@ export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
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 modifiedTxBody = TxBody.fromPartial({
...txBody,

View File

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