Skip to content

Commit

Permalink
[Mega-Linter] Apply linters fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matevz authored and actions-user committed Mar 21, 2022
1 parent e396059 commit 68ea3e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/app/lib/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { WalletError, WalletErrors } from 'types/errors'
import { hex2uint } from './helpers'
import type Transport from '@ledgerhq/hw-transport'

export const DerivationPathAdr8 = 'adr8';
export const DerivationPathLegacy = 'legacy';
export const DerivationPathAdr8 = 'adr8'
export const DerivationPathLegacy = 'legacy'

interface Response {
return_code: number
Expand Down Expand Up @@ -40,12 +40,12 @@ export class Ledger {
public static mustGetPath(pathType: string, i: number) {
switch (pathType) {
case DerivationPathAdr8:
return [44, 474, i];
return [44, 474, i]
case DerivationPathLegacy:
return [44, 474, 0, 0, i];
return [44, 474, 0, 0, i]
}

throw new TypeError("invalid pathType: "+pathType);
throw new TypeError('invalid pathType: ' + pathType)
}

public static async enumerateAccounts(transport: Transport, pathType: string, count = 5) {
Expand All @@ -58,7 +58,7 @@ export class Ledger {
throw new WalletError(WalletErrors.LedgerOasisAppIsNotOpen, 'Oasis App is not open')
}
for (let i = 0; i < count; i++) {
const path = Ledger.mustGetPath(pathType, i);
const path = Ledger.mustGetPath(pathType, i)
const publicKeyResponse = successOrThrow(await app.publicKey(path), 'ledger public key')
accounts.push({ path, publicKey: new Uint8Array(publicKeyResponse.pk as Buffer) })
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/OpenWalletPage/Features/FromLedger/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function FromLedgerModal(props: FromLedgerModalProps) {
const cancelDisabled = ledger.step === LedgerStep.Done || error ? false : true
const confirmDisabled = ledger.step !== LedgerStep.Done || selectedAccounts.length === 0
// TODO
const [value, setValue] = useState('');
const [value, setValue] = useState('')

return (
<ResponsiveLayer position="center" modal>
Expand All @@ -129,8 +129,8 @@ export function FromLedgerModal(props: FromLedgerModalProps) {
{t('openWallet.ledger.selectWallets', 'Select the wallets to open')}
</Heading>
<Select
id='DerivationPathSelect'
options={[ DerivationPathAdr8, DerivationPathLegacy ]}
id="DerivationPathSelect"
options={[DerivationPathAdr8, DerivationPathLegacy]}
value={DerivationPathAdr8}
onChange={({ value: nextValue }) => setValue(nextValue)}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/app/state/ledger/saga.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expectSaga } from 'redux-saga-test-plan'
import { ledgerActions } from '.'
import { ledgerSaga, sign } from './saga'
import * as matchers from 'redux-saga-test-plan/matchers'
import {DerivationPathAdr8, DerivationPathLegacy, Ledger, LedgerSigner} from 'app/lib/ledger'
import { DerivationPathAdr8, DerivationPathLegacy, Ledger, LedgerSigner } from 'app/lib/ledger'
import { getBalance } from '../wallet/saga'
import { addressToPublicKey } from 'app/lib/helpers'
import { LedgerStep } from './types'
Expand Down
2 changes: 1 addition & 1 deletion src/app/state/ledger/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import TransportWebUSB from '@ledgerhq/hw-transport-webusb'
import * as oasis from '@oasisprotocol/client'
import { publicKeyToAddress, uint2hex } from 'app/lib/helpers'
import {DerivationPathAdr8, Ledger, LedgerSigner} from 'app/lib/ledger'
import { DerivationPathAdr8, Ledger, LedgerSigner } from 'app/lib/ledger'
import { OasisTransaction } from 'app/lib/transaction'
import { all, call, put, select, takeEvery } from 'typed-redux-saga'
import { ErrorPayload, WalletError, WalletErrors } from 'types/errors'
Expand Down

0 comments on commit 68ea3e5

Please sign in to comment.