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