Skip to content

Commit

Permalink
fix challenge validate() v3
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Dec 5, 2023
1 parent 18fe29e commit 40aaafa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/circuits/atomic-query-v3-on-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ export class AtomicQueryV3OnChainInputs extends BaseConfig {
throw new Error(CircuitError.InvalidProofType);
}

if (!this.gistProof.proof) {
throw new Error(CircuitError.EmptyGISTProof);
}

if (!this.challenge) {
throw new Error(CircuitError.EmptyChallenge);
}

if (this.authEnabled === 1) {
if (!this.authClaimIncMtp) {
throw new Error(CircuitError.EmptyAuthClaimProof);
Expand All @@ -74,17 +82,9 @@ export class AtomicQueryV3OnChainInputs extends BaseConfig {
throw new Error(CircuitError.EmptyAuthClaimNonRevProof);
}

if (!this.gistProof.proof) {
throw new Error(CircuitError.EmptyGISTProof);
}

if (!this.signature) {
throw new Error(CircuitError.EmptyChallengeSignature);
}

if (!this.challenge) {
throw new Error(CircuitError.EmptyChallenge);
}
}

if (this.proofType === ProofType.BJJSignature) {
Expand Down

0 comments on commit 40aaafa

Please sign in to comment.