Skip to content

Commit

Permalink
eslint: fix misc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnerdhair committed Mar 22, 2022
1 parent d7a247f commit 97fba4e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions integration/src/wallets/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as native from "@shapeshiftoss/hdwallet-native";
import * as _ from "lodash";

// TODO: clean this up
// eslint-disable-next-line jest/no-mocks-import
import mswMock from "../../../packages/hdwallet-native/__mocks__/mswMock";

const mnemonic = "all all all all all all all all all all all all";
Expand Down
1 change: 1 addition & 0 deletions packages/hdwallet-core/src/eos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface EosToSignTx {
}

/* device response asking for next action */
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface EosTxActionRequest {}

/*
Expand Down
2 changes: 1 addition & 1 deletion packages/hdwallet-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function bip32ToAddressNList(path: string): number[] {
if (segments.length === 1 && segments[0] === "") return [];
const ret = new Array(segments.length);
for (let i = 0; i < segments.length; i++) {
const tmp = /(\d+)([hH\']?)/.exec(segments[i]);
const tmp = /(\d+)([hH']?)/.exec(segments[i]);
if (tmp === null) {
throw new Error("Invalid input");
}
Expand Down
8 changes: 6 additions & 2 deletions packages/hdwallet-keepkey/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export class Adapter<DelegateType extends AdapterDelegate<any>> {
const { productName, serialNumber } = await this.inspectDevice(device);
try {
await this.keyring.remove(serialNumber);
} catch {}
} catch {
// swallow keyring removal errors
}
await this.keyring.emit([productName, serialNumber, core.Events.DISCONNECT], serialNumber);
}

Expand Down Expand Up @@ -133,7 +135,9 @@ export class Adapter<DelegateType extends AdapterDelegate<any>> {
let defaultDevice: DeviceType<DelegateType> | undefined = undefined;
try {
defaultDevice = await this.getDevice();
} catch {}
} catch {
// swallow default device fetch errors
}
return defaultDevice ? [defaultDevice] : [];
}

Expand Down
1 change: 1 addition & 0 deletions packages/hdwallet-keepkey/src/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ export async function btcSignTx(

try {
// Begin callback loop
// eslint-disable-next-line no-constant-condition
while (true) {
if (responseType !== Messages.MessageType.MESSAGETYPE_TXREQUEST) {
throw new Error(`Unexpected message type: ${responseType}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { AsyncCrypto } from "./types";

// (This is also used in index.test.ts)
// eslint-disable-next-line jest/no-export
export async function deterministicGetRandomValues(crypto: AsyncCrypto, seed: Uint8Array = new Uint8Array(32)) {
const rngSeed = await crypto.subtle.importKey(
"raw",
Expand Down
1 change: 1 addition & 0 deletions packages/hdwallet-native-vault/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const preparedOnce = new Promise<void>((resolve) => (prepareOnce = resolve)).the

// eslint-disable-next-line @typescript-eslint/no-shadow
function testVaultImpl(name: string, Vault: ISealableVaultFactory<IVault>) {
// eslint-disable-next-line jest/valid-title
describe(name, () => {
beforeAll(async () => {
prepareOnce();
Expand Down

0 comments on commit 97fba4e

Please sign in to comment.