Skip to content

Commit

Permalink
fix: Remove static Credential.credentialStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed May 5, 2020
1 parent 4b17689 commit f9a06af
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 34 deletions.
3 changes: 0 additions & 3 deletions packages/daf-core/src/entities/credential.ts
Expand Up @@ -83,9 +83,6 @@ export class Credential extends BaseEntity {
@Column({ nullable: true })
expirationDate?: Date

@Column('simple-json', { nullable: true })
credentialStatus?: object

@Column('simple-array')
context: string[]

Expand Down
1 change: 0 additions & 1 deletion packages/daf-core/src/graphql/graphql-core.ts
Expand Up @@ -732,7 +732,6 @@ export const typeDefs = `
context: [String]
type: [String]
credentialSubject: Object
credentialStatus: Object
claims: [Claim]
presentations: [Presentation]
messages: [Message]
Expand Down
23 changes: 0 additions & 23 deletions packages/daf-core/src/migrations/CredentialStatus1587985317000.ts

This file was deleted.

4 changes: 1 addition & 3 deletions packages/daf-core/src/migrations/index.ts
@@ -1,3 +1 @@
import { CredentialStatus1587985317000 } from './CredentialStatus1587985317000'

export const migrations = [CredentialStatus1587985317000]
export const migrations = []
9 changes: 6 additions & 3 deletions packages/daf-w3c/src/__tests__/credentialStatus.test.ts
@@ -1,7 +1,8 @@
import { W3cActionHandler, ActionTypes, ActionSignW3cVc } from '../index'
import { SimpleSigner } from 'did-jwt'
import { SimpleSigner, decodeJWT } from 'did-jwt'
import { Resolver } from 'did-resolver'
import { ActionSignW3cVp } from '../action-handler'
import { Credential } from 'daf-core'

const privateKey = 'a285ab66393c5fdda46d6fbad9e27fafd438254ab72ad5acb681a0e9f20f5d7b'
const signerAddress = '0x2036c6cd85692f0fb2c26e6c6b2eced9e4478dfd'
Expand Down Expand Up @@ -92,14 +93,16 @@ describe('daf-w3c', () => {
},
}

let result = await actionHandler.handleAction(
let result: Credential = await actionHandler.handleAction(
{
type: ActionTypes.signCredentialJwt,
data,
} as ActionSignW3cVc,
mockAgent as any,
)

expect(result.credentialStatus).toMatchObject({ type: 'TestStatusMethod', id: 'local' })
const decoded = decodeJWT(result.raw)

expect(decoded.payload.credentialStatus).toMatchObject({ type: 'TestStatusMethod', id: 'local' })
})
})
1 change: 0 additions & 1 deletion packages/daf-w3c/src/__tests__/message-handler.test.ts
Expand Up @@ -136,6 +136,5 @@ describe('daf-w3c', () => {
expect(handled.type).toEqual(MessageTypes.vc)
expect(handled.from.did).toEqual('did:ethr:0x54d59e3ffd76917f62db702ac354b17f3842955e')
expect(handled.to.did).toEqual('did:web:uport.me')
expect(handled.credentials[0].credentialStatus).toEqual(message.data['credentialStatus'])
})
})

0 comments on commit f9a06af

Please sign in to comment.