Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
sabineschaller committed Aug 15, 2024
1 parent fdaf29b commit 5e81569
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { createWalletAddress } from '../../../tests/walletAddress'
import { WalletAddressService } from '../service'
import { OpenPaymentsServerRouteError } from '../../route-errors'
import assert from 'assert'
import { isWalletAddressKeyError } from './errors'

const TEST_KEY = generateJwk({ keyId: uuid() })

Expand Down Expand Up @@ -52,6 +53,7 @@ describe('Wallet Address Keys Routes', (): void => {
jwk: TEST_KEY
}
const key = await walletAddressKeyService.create(keyOption)
assert.ok(!isWalletAddressKeyError(key))

const ctx = createContext<WalletAddressUrlContext>({
headers: { Accept: 'application/json' },
Expand Down
7 changes: 6 additions & 1 deletion packages/backend/src/tests/walletAddressKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { WalletAddressKey } from '../open_payments/wallet_address/key/model'
import { CreateOptions } from '../open_payments/wallet_address/key/service'
import { v4 as uuidv4 } from 'uuid'
import { generateJwk, generateKey } from '@interledger/http-signature-utils'
import { isWalletAddressKeyError } from '../open_payments/wallet_address/key/errors'
export async function createWalletAddressKey(
deps: IocContract<AppServices>,
walletAddressId: string
Expand All @@ -18,5 +19,9 @@ export async function createWalletAddressKey(
})
}

return walletAddressKeyService.create(options)
const keyOrError = await walletAddressKeyService.create(options)
if (isWalletAddressKeyError(keyOrError)) {
throw keyOrError
}
return keyOrError
}

0 comments on commit 5e81569

Please sign in to comment.