mirror of
https://github.com/zkitter/ui.git
synced 2026-01-09 13:18:00 -05:00
Fix zkpr
This commit is contained in:
@@ -307,15 +307,16 @@ export const submitZKPRPost = (post: Post) => async (dispatch: Dispatch, getStat
|
||||
} = post.toJSON();
|
||||
|
||||
const externalNullifier = genExternalNullifier('POST');
|
||||
const wasmFilePath = `${config.indexerAPI}/dev/semaphore_wasm`;
|
||||
const finalZkeyPath = `${config.indexerAPI}/dev/semaphore_final_zkey`;
|
||||
const wasmFilePath = `${config.indexerAPI}/circuits/rln/wasm`;
|
||||
const finalZkeyPath = `${config.indexerAPI}/circuits/rln/zkey`;
|
||||
|
||||
const { fullProof } = await zkpr.semaphoreProof(
|
||||
const {proof, publicSignals} = await zkpr.rlnProof(
|
||||
externalNullifier,
|
||||
hash,
|
||||
wasmFilePath,
|
||||
finalZkeyPath,
|
||||
'',
|
||||
await sha256('zkpost'),
|
||||
{
|
||||
root: root.toString(),
|
||||
leaf: identityCommitment,
|
||||
@@ -324,10 +325,10 @@ export const submitZKPRPost = (post: Post) => async (dispatch: Dispatch, getStat
|
||||
}
|
||||
)
|
||||
|
||||
const {
|
||||
proof,
|
||||
publicSignals,
|
||||
} = fullProof;
|
||||
// const {
|
||||
// proof,
|
||||
// publicSignals,
|
||||
// } = fullProof;
|
||||
|
||||
try {
|
||||
// @ts-ignore
|
||||
|
||||
@@ -7,7 +7,7 @@ import {Identity} from "../serviceWorkers/identity";
|
||||
import {postWorkerMessage} from "../util/sw";
|
||||
import {selectIdentity, setIdentity} from "../serviceWorkers/util";
|
||||
import {Dispatch} from "redux";
|
||||
import {SemaphoreFullProof, SemaphoreSolidityProof, MerkleProof} from "@zk-kit/protocols";
|
||||
import {SemaphoreFullProof, SemaphoreSolidityProof, MerkleProof, RLNFullProof} from "@zk-kit/protocols";
|
||||
|
||||
enum ActionTypes {
|
||||
SET_LOADING = 'zkpr/setLoading',
|
||||
@@ -257,4 +257,28 @@ export class ZKPR {
|
||||
merkleProof,
|
||||
);
|
||||
}
|
||||
|
||||
async rlnProof(
|
||||
externalNullifier: string,
|
||||
signal: string,
|
||||
circuitFilePath: string,
|
||||
zkeyFilePath: string,
|
||||
merkleProofArtifactsOrStorageAddress: string | {
|
||||
leaves: string[];
|
||||
depth: number;
|
||||
leavesPerNode: number;
|
||||
},
|
||||
rlnIdentifier: string,
|
||||
merkleProof?: MerkleProof,
|
||||
): Promise<RLNFullProof> {
|
||||
return this.client.rlnProof(
|
||||
externalNullifier,
|
||||
signal,
|
||||
circuitFilePath,
|
||||
zkeyFilePath,
|
||||
merkleProofArtifactsOrStorageAddress,
|
||||
rlnIdentifier,
|
||||
merkleProof,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user