Skip to content

Commit

Permalink
uupdate README
Browse files Browse the repository at this point in the history
  • Loading branch information
susumutomita committed Feb 3, 2024
1 parent 4c74457 commit 9127f7b
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions packages/frontend/src/sindri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,12 @@ async function pollForStatus(endpoint: string, timeout: number = 20 * 60) {
throw new Error(`Polling timed out after ${timeout} seconds.`);
}

function parseTOML(tomlString: string): Record<string, any> {
const result: Record<string, any> = {};
const lines = tomlString.split(/\r?\n/);

lines.forEach((line) => {
if (line.trim().startsWith('#') || line.trim() === '') return;
const [key, value] = line.split('=').map((s) => s.trim());
if (value === 'true') {
result[key] = true;
} else if (value === 'false') {
result[key] = false;
} else if (!isNaN(Number(value))) {
result[key] = Number(value);
} else {
result[key] = value;
}
});

return result;
}

export async function generateProof(input: number) {
try {
const circuitId = 'e98c114f-6b0d-4fe0-9379-4ee91a1c6963';
console.log(circuitId);
console.log('Proving circuit...');
const tomlString = `input = ${input}`;
const proofInput = parseTOML(tomlString);
const proofInput = `input = ${input}`;
console.log(proofInput);
console.log(API_KEY);

Expand Down

0 comments on commit 9127f7b

Please sign in to comment.