Skip to content

Commit

Permalink
Fixed export CspProofType
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvelmer committed Jan 31, 2024
1 parent 3b6d15d commit d08135c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Buffer } from 'buffer';
import invariant from 'tiny-invariant';
import { AccountCore } from './core/account';
import { ElectionCore } from './core/election';
import { CspProofType, VoteCore } from './core/vote';
import { VoteCore } from './core/vote';
import {
Account,
AllElectionStatus,
Expand Down Expand Up @@ -39,6 +39,7 @@ import {
ChainCircuits,
ChainService,
CspCensusProof,
CspProofType,
CspService,
ElectionCreationSteps,
ElectionCreationStepValue,
Expand Down
7 changes: 0 additions & 7 deletions src/core/vote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ export type VotePackage = {
votes: VoteValues;
};

export enum CspProofType {
ECDSA = ProofCA_Type.ECDSA,
ECDSA_PIDSALTED = ProofCA_Type.ECDSA_PIDSALTED,
ECDSA_BLIND = ProofCA_Type.ECDSA_BLIND,
ECDSA_BLIND_PIDSALTED = ProofCA_Type.ECDSA_BLIND_PIDSALTED,
}

export abstract class VoteCore extends TransactionCore {
/**
* Cannot be constructed.
Expand Down
2 changes: 1 addition & 1 deletion src/services/census.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CensusType, ICensusParticipant, PlainCensus, WeightedCensus } from '../
import { CensusAPI, ICensusImportResponse, ICensusPublishResponse, WalletAPI } from '../api';
import { Wallet } from '@ethersproject/wallet';
import invariant from 'tiny-invariant';
import { CspProofType } from '../core/vote';
import { CspProofType } from './csp';

interface CensusServiceProperties {
auth: CensusAuth;
Expand Down
9 changes: 8 additions & 1 deletion src/services/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ import invariant from 'tiny-invariant';
import { CensusType, CspVote, Election, Vote } from '../types';
import { CspAPI, ICspInfoResponse } from '../api/csp';
import { CensusBlind, getBlindedPayload } from '../util/blind-signing';
import { CspProofType } from '../core/vote';
import { ProofCA_Type } from '@vocdoni/proto/vochain';

interface CspServiceProperties {
info: ICspInfoResponse;
}

type CspServiceParameters = ServiceProperties & CspServiceProperties;

export enum CspProofType {
ECDSA = ProofCA_Type.ECDSA,
ECDSA_PIDSALTED = ProofCA_Type.ECDSA_PIDSALTED,
ECDSA_BLIND = ProofCA_Type.ECDSA_BLIND,
ECDSA_BLIND_PIDSALTED = ProofCA_Type.ECDSA_BLIND_PIDSALTED,
}

export class CspService extends Service implements CspServiceProperties {
public info: ICspInfoResponse;

Expand Down
2 changes: 1 addition & 1 deletion src/types/vote/csp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vote } from './vote';
import { CspProofType } from '../../core/vote';
import { CspProofType } from '../../services';

export class CspVote extends Vote {
private _signature: string;
Expand Down
3 changes: 1 addition & 2 deletions test/integration/csp.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { ICspFinalStepResponse, ICspIntermediateStepResponse } from '../../src/api/csp';
import { Wallet } from '@ethersproject/wallet';
import { Election, VocdoniSDKClient, Vote } from '../../src';
import { CspProofType, Election, VocdoniSDKClient, Vote } from '../../src';
import { CspCensus } from '../../src';
// @ts-ignore
import { clientParams, setFaucetURL } from './util/client.params';
// @ts-ignore
import { waitForElectionReady } from './util/client.utils';
import { CspProofType } from '../../src/core/vote';

const CSP_URL = process.env.BLINDCSP_URL ?? 'https://csp-dev-simplemath.vocdoni.net/v1';
const CSP_PUBKEY = process.env.BLINDCSP_PUBKEY ?? '025de8cb8de1005aa939c1403e37e1fa165ebc758da49cb37215c6237d01591104';
Expand Down

0 comments on commit d08135c

Please sign in to comment.