mirror of
https://github.com/privacy-scaling-explorations/zk-kit.git
synced 2026-04-22 03:00:15 -04:00
style: format code with prettier
Former-commit-id: 61a0b9c7dad21e43c5eb80ed967bd8a986df8181 [formerly e48be969b240f9984c83ed786a4c2a5622527903] [formerly fea73dc3399d5fde9bd73017508e381052132855 [formerly d3e15b7e4c72cb4d69163cb52a663ed82b1f6a23]] [formerly 8cb5062f25e56e7bb8de2f67f0d87ae835076fa1 [formerly f39ee0eba58dddb0bddc553687d442dd2615c687] [formerly 2382485fa2895c5475b5fbdc4c333da7687ace6a [formerly ed6f53efa9]]]
Former-commit-id: 1d5c708921d1339d17384b2871028ef2039992f2 [formerly cfa7a34a2619bca7930fca001339cf4073f41a29] [formerly 8aae04c1c89a028d5d25dc5c8a97097c0a0c7dc0 [formerly d9ee48844e72bc837e033c115774fb16499b2e61]]
Former-commit-id: 15d01dc5cb1b357d791d7f959ad0329aeeb84512 [formerly 3d47743b4048bf2611f838c9a8ed85b26f03a2c4]
Former-commit-id: da55066ec552a5ceadff7edd794831b01cc5e5d0
This commit is contained in:
@@ -63,11 +63,7 @@ export default class ZkIdentity {
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!("identityNullifier" in metadata) ||
|
||||
!("identityTrapdoor" in metadata) ||
|
||||
!("secret" in metadata)
|
||||
) {
|
||||
if (!("identityNullifier" in metadata) || !("identityTrapdoor" in metadata) || !("secret" in metadata)) {
|
||||
throw new Error("The serialized identity does not contain the right parameter")
|
||||
}
|
||||
|
||||
@@ -116,13 +112,12 @@ export default class ZkIdentity {
|
||||
return poseidon(this._secret)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates the identity commitment from the secret.
|
||||
* @returns identity commitment
|
||||
*/
|
||||
public genIdentityCommitment(): bigint {
|
||||
return poseidon([this.getSecretHash()])
|
||||
return poseidon([this.getSecretHash()])
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +128,7 @@ export default class ZkIdentity {
|
||||
const data: SerializedIdentity = {
|
||||
identityNullifier: this._identityNullifier.toString(16),
|
||||
identityTrapdoor: this._identityTrapdoor.toString(16),
|
||||
secret: this._secret.map((item) => item.toString(16)),
|
||||
secret: this._secret.map((item) => item.toString(16))
|
||||
}
|
||||
|
||||
return JSON.stringify(data)
|
||||
|
||||
Reference in New Issue
Block a user