Skip to content

Commit

Permalink
use undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Jul 13, 2023
1 parent 2199c24 commit 10eca58
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 73 deletions.
30 changes: 15 additions & 15 deletions src/circuits/atomic-query-mtp-v2-on-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ import { byteDecoder, byteEncoder } from '../utils';
*/
export class AtomicQueryMTPV2OnChainInputs extends BaseConfig {
// auth
id: Id | null = null;
profileNonce: bigint | null = null;
claimSubjectProfileNonce: bigint | null = null;
id?: Id;
profileNonce?: bigint;
claimSubjectProfileNonce?: bigint;
// claim issued for user
claim: ClaimWithMTPProof | null = null;
skipClaimRevocationCheck: boolean | null = null;
requestID: bigint | null = null;
claim?: ClaimWithMTPProof;
skipClaimRevocationCheck?: boolean;
requestID?: bigint;

currentTimeStamp: number | null = null;
currentTimeStamp?: number;

authClaim: Claim | null = null;
authClaimIncMtp: Proof | null = null;
authClaimNonRevMtp: Proof | null = null;
treeState: TreeState | null = null;
authClaim?: Claim;
authClaimIncMtp?: Proof;
authClaimNonRevMtp?: Proof;
treeState?: TreeState;

gistProof: GISTProof | null = null;
gistProof?: GISTProof;

signature: Signature | null = null;
challenge: bigint | null = null;
signature?: Signature;
challenge?: bigint;

// query
query: Query | null = null;
query?: Query;

/**
* Validate inputs
Expand Down
16 changes: 8 additions & 8 deletions src/circuits/atomic-query-mtp-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ import { byteDecoder, byteEncoder } from '../utils';
*/
export class AtomicQueryMTPV2Inputs extends BaseConfig {
// auth
id: Id | null = null;
profileNonce: bigint | null = null;
claimSubjectProfileNonce: bigint | null = null;
id?: Id;
profileNonce?: bigint;
claimSubjectProfileNonce?: bigint;
// claim issued for user
claim: ClaimWithMTPProof | null = null;
skipClaimRevocationCheck: boolean | null = null;
requestID: bigint | null = null;
claim?: ClaimWithMTPProof;
skipClaimRevocationCheck?: boolean;
requestID?: bigint;

currentTimeStamp: number | null = null;
currentTimeStamp?: number;

// query
query: Query | null = null;
query?: Query;

/**
* Validate AtomicQueryMTPV2 inputs
Expand Down
30 changes: 15 additions & 15 deletions src/circuits/atomic-query-sig-v2-on-chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ import { byteDecoder, byteEncoder } from '../utils';
* @extends {BaseConfig}
*/
export class AtomicQuerySigV2OnChainInputs extends BaseConfig {
requestID: bigint | null = null;
requestID?: bigint;
// auth
id: Id | null = null;
profileNonce: bigint | null = null;
claimSubjectProfileNonce: bigint | null = null;
id?: Id;
profileNonce?: bigint;
claimSubjectProfileNonce?: bigint;

// claim issued for user
claim: ClaimWithSigProof | null = null;
skipClaimRevocationCheck: boolean | null = null;
claim?: ClaimWithSigProof;
skipClaimRevocationCheck?: boolean;

authClaim: Claim | null = null;
authClaim?: Claim;

authClaimIncMtp: Proof | null = null;
authClaimNonRevMtp: Proof | null = null;
treeState: TreeState | null = null;
authClaimIncMtp?: Proof;
authClaimNonRevMtp?: Proof;
treeState?: TreeState;

gistProof: GISTProof | null = null;
gistProof?: GISTProof;

signature: Signature | null = null;
challenge: bigint | null = null;
signature?: Signature;
challenge?: bigint;

// query
query: Query | null = null;
query?: Query;

currentTimeStamp: number | null = null;
currentTimeStamp?: number;

/**
* Validate inputs
Expand Down
16 changes: 8 additions & 8 deletions src/circuits/atomic-query-sig-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ import { byteDecoder, byteEncoder } from '../utils';
* @extends {BaseConfig}
*/
export class AtomicQuerySigV2Inputs extends BaseConfig {
requestID: bigint | null = null;
requestID?: bigint;
// auth
id: Id | null = null;
profileNonce: bigint | null = null;
claimSubjectProfileNonce: bigint | null = null;
id?: Id;
profileNonce?: bigint;
claimSubjectProfileNonce?: bigint;

// claim issued for user
claim: ClaimWithSigProof | null = null;
skipClaimRevocationCheck: boolean | null = null;
claim?: ClaimWithSigProof;
skipClaimRevocationCheck?: boolean;

currentTimeStamp: number | null = null;
currentTimeStamp?: number;

// query
query: Query | null = null;
query?: Query;

/**
* Validate inputs
Expand Down
24 changes: 12 additions & 12 deletions src/circuits/auth-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import { byteDecoder, byteEncoder } from '../utils';
* @extends {BaseConfig}
*/
export class AuthV2Inputs extends BaseConfig {
genesisID?: Id | null = null;
profileNonce: bigint | null = null;
authClaim: Claim | null = null;
authClaimIncMtp: Proof | null = null;
authClaimNonRevMtp: Proof | null = null;
treeState: TreeState | null = null;
gistProof: GISTProof | null = null;
signature: Signature | null = null;
challenge: bigint | null = null;
genesisID?: Id;
profileNonce?: bigint;
authClaim?: Claim;
authClaimIncMtp?: Proof;
authClaimNonRevMtp?: Proof;
treeState?: TreeState;
gistProof?: GISTProof;
signature?: Signature;
challenge?: bigint;

validate(): void {
if (!this.genesisID) {
Expand Down Expand Up @@ -130,9 +130,9 @@ interface AuthV2CircuitInputs {
* @class AuthV2PubSignals
*/
export class AuthV2PubSignals {
userID: Id | null = null;
challenge: bigint | null = null;
GISTRoot: Hash | null = null;
userID?: Id;
challenge?: bigint;
GISTRoot?: Hash;
//

/**
Expand Down
8 changes: 4 additions & 4 deletions src/circuits/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ export const ErrorEmptyIssuerAuthClaimNonRevProof =
* @class BaseConfig
*/
export class BaseConfig {
mtLevel: number | null = null; // Max levels of MT
valueArraySize: number | null = null; // Size if( value array in identity circuit)s
mtLevelOnChain: number | null = null;
mtLevelClaimsMerklization: number | null = null; // max levels in the merklization
mtLevel?: number; // Max levels of MT
valueArraySize?: number; // Size if( value array in identity circuit)s
mtLevelOnChain?: number;
mtLevelClaimsMerklization?: number; // max levels in the merklization

/**
* getMTLevel max circuit MT levels
Expand Down
22 changes: 11 additions & 11 deletions src/circuits/state-transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ import { byteDecoder, byteEncoder } from '../utils';
* @extends {BaseConfig}
*/
export class StateTransitionInputs extends BaseConfig {
id: Id | null = null;
oldTreeState: TreeState | null = null;
newTreeState: TreeState | null = null;
id?: Id;
oldTreeState?: TreeState;
newTreeState?: TreeState;

isOldStateGenesis: boolean | null = null;
authClaim: ClaimWithMTPProof | null = null;
isOldStateGenesis?: boolean;
authClaim?: ClaimWithMTPProof;

authClaimNewStateIncProof: Proof | null = null;
authClaimNewStateIncProof?: Proof;

signature: Signature | null = null;
signature?: Signature;

/**
* CircuitInputMarshal returns Circom private inputs for stateTransition.circom
Expand Down Expand Up @@ -109,10 +109,10 @@ interface StateTransitionInputsInternal {
* @class StateTransitionPubSignals
*/
export class StateTransitionPubSignals {
userId: Id | null = null;
oldUserState: Hash | null = null;
newUserState: Hash | null = null;
isOldStateGenesis: boolean | null = null;
userId?: Id;
oldUserState?: Hash;
newUserState?: Hash;
isOldStateGenesis?: boolean;

/**
*
Expand Down

0 comments on commit 10eca58

Please sign in to comment.