Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions tests/integration/disclosure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// @ts-ignore - circomlibjs doesn't have types
import { buildPoseidon } from 'circomlibjs';
import { generateProof, CircuitType, isReady } from '../../src';
import { generateProof, CircuitType } from '../../src';

describe('Integration: Disclosure Proof Generation', () => {
let poseidon: any;
Expand All @@ -24,13 +24,7 @@ describe('Integration: Disclosure Proof Generation', () => {
poseidon = await buildPoseidon();
});

// Skip this test if artifacts are not available
it('should generate a valid disclosure proof', async () => {
// Check if proof generator is ready
if (!isReady()) {
console.warn('⚠️ Skipping: Proof generator not ready. Run: npm run build');
return;
}
const F = poseidon.F;

// Create note
Expand Down Expand Up @@ -112,10 +106,6 @@ describe('Integration: Disclosure Proof Generation', () => {
}, 30000); // 30 second timeout

it('should fail with invalid inputs', async () => {
if (!isReady()) {
return;
}

await expect(
generateProof(CircuitType.Disclosure, {
commitment: 'invalid',
Expand All @@ -124,10 +114,6 @@ describe('Integration: Disclosure Proof Generation', () => {
});

it('should fail with missing required fields', async () => {
if (!isReady()) {
return;
}

await expect(
generateProof(CircuitType.Disclosure, {
commitment: '123',
Expand All @@ -137,10 +123,6 @@ describe('Integration: Disclosure Proof Generation', () => {
});

it('should fail with null/undefined inputs', async () => {
if (!isReady()) {
return;
}

await expect(
// @ts-ignore - Testing invalid input
generateProof(CircuitType.Disclosure, null)
Expand Down
20 changes: 1 addition & 19 deletions tests/integration/transfer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// @ts-ignore - circomlibjs doesn't have types
import { buildPoseidon, buildEddsa, buildBabyjub } from 'circomlibjs';
import { generateProof, CircuitType, isReady } from '../../src';
import { generateProof, CircuitType } from '../../src';

describe('Integration: Transfer Proof Generation', () => {
let poseidon: any;
Expand All @@ -29,13 +29,7 @@ describe('Integration: Transfer Proof Generation', () => {
babyJub = await buildBabyjub();
});

// Skip this test if artifacts are not available
it('should generate a valid transfer proof', async () => {
// Check if proof generator is ready
if (!isReady()) {
console.warn('⚠️ Skipping: Proof generator not ready. Run: npm run build');
return;
}
const F = poseidon.F;

// Generate EdDSA keypairs for input note owners
Expand Down Expand Up @@ -233,10 +227,6 @@ describe('Integration: Transfer Proof Generation', () => {
}, 30000); // 30 second timeout

it('should fail with invalid inputs', async () => {
if (!isReady()) {
return;
}

await expect(
generateProof(CircuitType.Transfer, {
merkle_root: 'invalid',
Expand All @@ -245,10 +235,6 @@ describe('Integration: Transfer Proof Generation', () => {
});

it('should fail with missing required fields', async () => {
if (!isReady()) {
return;
}

await expect(
generateProof(CircuitType.Transfer, {
merkle_root: '123',
Expand All @@ -258,10 +244,6 @@ describe('Integration: Transfer Proof Generation', () => {
});

it('should fail with null/undefined inputs', async () => {
if (!isReady()) {
return;
}

await expect(
// @ts-ignore - Testing invalid input
generateProof(CircuitType.Transfer, null)
Expand Down
8 changes: 1 addition & 7 deletions tests/integration/unshield.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// @ts-ignore - circomlibjs doesn't have types
import { buildPoseidon } from 'circomlibjs';
import { generateProof, CircuitType, isReady } from '../../src';
import { generateProof, CircuitType } from '../../src';

describe('Integration: Unshield Proof Generation', () => {
let poseidon: any;
Expand All @@ -24,13 +24,7 @@ describe('Integration: Unshield Proof Generation', () => {
poseidon = await buildPoseidon();
});

// Skip this test if artifacts are not available
it('should generate a valid unshield proof', async () => {
// Check if proof generator is ready
if (!isReady()) {
console.warn('⚠️ Skipping: Proof generator not ready. Run: npm run build');
return;
}
const F = poseidon.F;

// Create note
Expand Down