Skip to content

Commit

Permalink
fix: optional timestamp in updaterevstatuslist
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
  • Loading branch information
genaris committed Nov 6, 2023
1 parent 89d60cd commit 61ac750
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class AnonCredsRsIssuerService implements AnonCredsIssuerService {
revocationRegistryDefinitionPrivate: revocationRegistryDefinitionPrivateRecord.value,
issued: options.issued,
revoked: options.revoked,
timestamp,
timestamp: timestamp ?? -1, // FIXME: this should be fixed in anoncreds-rs wrapper
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
V2OfferCredentialMessage,
} from '@aries-framework/core'

import { describeRunInNodeVersion } from '../../../tests/runInVersion'
import { InMemoryAnonCredsRegistry } from '../../anoncreds/tests/InMemoryAnonCredsRegistry'
import { waitForCredentialRecordSubject } from '../../core/tests'
import { waitForRevocationNotification } from '../../core/tests/helpers'
Expand All @@ -25,7 +24,7 @@ const credentialPreview = V2CredentialPreview.fromRecord({
profile_picture: 'profile picture',
})

describeRunInNodeVersion([18], 'IC v2 credential revocation', () => {
describe('IC v2 credential revocation', () => {
let faberAgent: AnonCredsTestsAgent
let aliceAgent: AnonCredsTestsAgent
let credentialDefinitionId: string
Expand Down
3 changes: 1 addition & 2 deletions packages/anoncreds-rs/tests/v2-credentials.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
V2RequestCredentialMessage,
} from '@aries-framework/core'

import { describeRunInNodeVersion } from '../../../tests/runInVersion'
import { InMemoryAnonCredsRegistry } from '../../anoncreds/tests/InMemoryAnonCredsRegistry'
import { waitForCredentialRecord, waitForCredentialRecordSubject } from '../../core/tests'
import testLogger from '../../core/tests/logger'
Expand All @@ -29,7 +28,7 @@ const credentialPreview = V2CredentialPreview.fromRecord({
profile_picture: 'profile picture',
})

describeRunInNodeVersion([18], 'IC V2 AnonCreds credentials', () => {
describe('IC V2 AnonCreds credentials', () => {
let faberAgent: AnonCredsTestsAgent
let aliceAgent: AnonCredsTestsAgent
let credentialDefinitionId: string
Expand Down
15 changes: 10 additions & 5 deletions packages/anoncreds-rs/tests/v2-proofs.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
V2PresentationMessage,
} from '@aries-framework/core'

import { describeRunInNodeVersion } from '../../../tests/runInVersion'
import { dateToTimestamp } from '../../anoncreds/src/utils/timestamp'
import { InMemoryAnonCredsRegistry } from '../../anoncreds/tests/InMemoryAnonCredsRegistry'
import { sleep } from '../../core/src/utils/sleep'
Expand All @@ -23,7 +22,7 @@ import testLogger from '../../core/tests/logger'

import { issueAnonCredsCredential, setupAnonCredsTests } from './anoncredsSetup'

describeRunInNodeVersion([18], 'PP V2 AnonCreds Proofs', () => {
describe('PP V2 AnonCreds Proofs', () => {
let faberAgent: AnonCredsTestsAgent
let faberReplay: EventReplaySubject
let aliceAgent: AnonCredsTestsAgent
Expand Down Expand Up @@ -896,7 +895,7 @@ describeRunInNodeVersion([18], 'PP V2 AnonCreds Proofs', () => {
})
})

test('Credential is revoked before proof request', async () => {
test.only('Credential is revoked before proof request', async () => {
// Revoke the credential
const credentialRevocationRegistryDefinitionId = faberCredentialExchangeRecord.getTag(
'anonCredsRevocationRegistryId'
Expand Down Expand Up @@ -980,7 +979,6 @@ describeRunInNodeVersion([18], 'PP V2 AnonCreds Proofs', () => {

const faberProofExchangeRecordPromise = waitForProofExchangeRecord(faberAgent, {
threadId: aliceProofExchangeRecord.threadId,
state: ProofState.PresentationReceived,
})

await aliceAgent.proofs.acceptRequest({
Expand All @@ -996,7 +994,14 @@ describeRunInNodeVersion([18], 'PP V2 AnonCreds Proofs', () => {
expect(faberProofExchangeRecord).toMatchObject({
threadId: aliceProofExchangeRecord.threadId,
isVerified: false,
state: ProofState.PresentationReceived,
state: ProofState.Abandoned,
})

// Faber will send a problem report, meaning for Alice that the proof state is abandoned
// as well
await waitForProofExchangeRecord(aliceAgent, {
threadId: aliceProofExchangeRecord.threadId,
state: ProofState.Abandoned,
})
})
})

0 comments on commit 61ac750

Please sign in to comment.