Skip to content

Commit

Permalink
style: formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Oct 7, 2024
1 parent bba8d9c commit efd9577
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 5 additions & 6 deletions packages/askar/src/wallet/AskarBaseWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
} from '../utils'

import { didcommV1Pack, didcommV1Unpack } from './didcommV1'
import { ariesAskarNodeJS } from '@hyperledger/aries-askar-nodejs'

const isError = (error: unknown): error is Error => error instanceof Error

Expand Down Expand Up @@ -175,8 +174,8 @@ export abstract class AskarBaseWallet implements Wallet {
const _key = privateKey
? AskarKey.fromSecretBytes({ secretKey: privateKey, algorithm })
: seed
? AskarKey.fromSeed({ seed, algorithm })
: AskarKey.generate(algorithm)
? AskarKey.fromSeed({ seed, algorithm })

Check failure on line 177 in packages/askar/src/wallet/AskarBaseWallet.ts

View workflow job for this annotation

GitHub Actions / Validate

Delete `··`
: AskarKey.generate(algorithm)

Check failure on line 178 in packages/askar/src/wallet/AskarBaseWallet.ts

View workflow job for this annotation

GitHub Actions / Validate

Delete `··`

// FIXME: we need to create a separate const '_key' so TS definitely knows _key is defined in the session callback.
// This will be fixed once we use the new 'using' syntax
Expand Down Expand Up @@ -311,9 +310,9 @@ export abstract class AskarBaseWallet implements Wallet {
askarKey ??
(keyPair
? AskarKey.fromSecretBytes({
secretKey: TypedArrayEncoder.fromBase58(keyPair.privateKeyBase58),
algorithm: keyAlgFromString(keyPair.keyType),
})
secretKey: TypedArrayEncoder.fromBase58(keyPair.privateKeyBase58),

Check failure on line 313 in packages/askar/src/wallet/AskarBaseWallet.ts

View workflow job for this annotation

GitHub Actions / Validate

Insert `··`
algorithm: keyAlgFromString(keyPair.keyType),

Check failure on line 314 in packages/askar/src/wallet/AskarBaseWallet.ts

View workflow job for this annotation

GitHub Actions / Validate

Insert `··`
})

Check failure on line 315 in packages/askar/src/wallet/AskarBaseWallet.ts

View workflow job for this annotation

GitHub Actions / Validate

Insert `··`
: undefined)

if (!askarKey) {
Expand Down
10 changes: 6 additions & 4 deletions packages/askar/src/wallet/__tests__/AskarWallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import type {
SignOptions,
VerifyOptions,
} from '@credo-ts/core'
import { Key as AskarKey } from '@hyperledger/aries-askar-nodejs'
import type { JwkProps } from '@hyperledger/aries-askar-shared'

import {
WalletKeyExistsError,
Key,
Expand All @@ -21,15 +22,16 @@ import {
Buffer,
JsonEncoder,
} from '@credo-ts/core'
import { Jwk, JwkProps, Store } from '@hyperledger/aries-askar-shared'
import { Key as AskarKey } from '@hyperledger/aries-askar-nodejs'
import { Jwk, Store } from '@hyperledger/aries-askar-shared'
import { readFileSync } from 'fs'
import path from 'path'

import { KeyBackend } from '../../../../core/src/crypto/KeyBackend'
import { encodeToBase58 } from '../../../../core/src/utils/base58'
import { agentDependencies } from '../../../../core/tests/helpers'
import testLogger from '../../../../core/tests/logger'
import { AskarWallet } from '../AskarWallet'
import { readFileSync, writeFileSync } from 'fs'
import path from 'path'

// use raw key derivation method to speed up wallet creating / opening / closing between tests
const walletConfig: WalletConfig = {
Expand Down

0 comments on commit efd9577

Please sign in to comment.