Minor updates #1

Closed
tornadocontrib wants to merge 67 commits from tornadocontrib/tornado-core:main into main
2 changed files with 20 additions and 3 deletions
Showing only changes of commit c155649719 - Show all commits

10
dist/websnark.d.ts vendored
View File

@ -11,9 +11,17 @@ export type snarkInputs = {
pathElements: Element[];
pathIndices: Element[];
};
export type snarkArgs = [
_root: string,
_nullifierHash: string,
_recipient: string,
_relayer: string,
_fee: string,
_refund: string
];
export type snarkProofs = {
proof: string;
args: string[];
args: snarkArgs;
};
export declare function initGroth16(): Promise<void>;
export declare function calculateSnarkProof(input: snarkInputs, circuit: object, provingKey: ArrayBuffer): Promise<snarkProofs>;

View File

@ -21,9 +21,18 @@ export type snarkInputs = {
pathIndices: Element[];
};
export type snarkArgs = [
_root: string,
_nullifierHash: string,
_recipient: string,
_relayer: string,
_fee: string,
_refund: string,
];
export type snarkProofs = {
proof: string;
args: string[];
args: snarkArgs;
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@ -71,7 +80,7 @@ export async function calculateSnarkProof(
input.relayer,
toFixedHex(input.fee, 32),
toFixedHex(input.refund, 32),
];
] as snarkArgs;
return { proof, args };
}