Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bug/credential_preview' into bug…
Browse files Browse the repository at this point in the history
…/credential_preview
  • Loading branch information
Annelein committed Feb 10, 2022
2 parents 4392790 + 17b7806 commit b283563
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/modules/ledger/IndyPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AriesFrameworkError, IndySdkError } from '../../error'
import { isIndyError } from '../../utils/indyError'

import { LedgerError } from './error/LedgerError'
import { isLedgerRejectResponse } from './ledgerUtil'
import { isLedgerRejectResponse, isLedgerReqnackResponse } from './ledgerUtil'

export interface IndyPoolConfig {
genesisPath?: string
Expand Down Expand Up @@ -122,7 +122,7 @@ export class IndyPool {
public async submitReadRequest(request: Indy.LedgerRequest) {
const response = await this.submitRequest(request)

if (isLedgerRejectResponse(response)) {
if (isLedgerRejectResponse(response) || isLedgerReqnackResponse(response)) {
throw new LedgerError(`Ledger '${this.id}' rejected read transaction request: ${response.reason}`)
}

Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/modules/ledger/ledgerUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ import type * as Indy from 'indy-sdk'
export function isLedgerRejectResponse(response: Indy.LedgerResponse): response is Indy.LedgerRejectResponse {
return response.op === 'REJECT'
}

export function isLedgerReqnackResponse(response: Indy.LedgerResponse): response is Indy.LedgerReqnackResponse {
return response.op === 'REQNACK'
}

0 comments on commit b283563

Please sign in to comment.