本文整理汇总了TypeScript中src.IssuerCredential类的典型用法代码示例。如果您正苦于以下问题:TypeScript IssuerCredential类的具体用法?TypeScript IssuerCredential怎么用?TypeScript IssuerCredential使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IssuerCredential类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: shouldThrow
const error = await shouldThrow(async () => IssuerCredential.deserialize({ data: {
cred_def_id: 'Invalid',
credential_attributes: '{}',
credential_name: 'Invalid',
price: 'Invalid',
source_id: 'Invalid'
} } as any))
示例2: it
it('success', async () => {
const issuerCredential1 = await issuerCredentialCreate()
const data1 = await issuerCredential1.serialize()
const issuerCredential2 = await IssuerCredential.deserialize(data1)
assert.equal(issuerCredential2.sourceId, issuerCredential1.sourceId)
const data2 = await issuerCredential2.serialize()
assert.deepEqual(data1, data2)
})
示例3: async
export const issuerCredentialCreate = async (_data = dataIssuerCredentialCreate()) => {
const data = await _data
const issuerCredential = await IssuerCredential.create(data)
assert.notEqual(issuerCredential.handle, undefined)
assert.equal(issuerCredential.sourceId, data.sourceId)
assert.equal(issuerCredential.credDefHandle, data.credDefHandle)
assert.equal(issuerCredential.credentialName, data.credentialName)
assert.equal(issuerCredential.price, data.price)
return issuerCredential
}