mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
checking if commitment is registered before trying to register it again
This commit is contained in:
@@ -163,7 +163,7 @@ export function generateCircuitInputsDisclose(
|
||||
// this get the commitment index whether it is a string or a bigint
|
||||
// this is necessary rn because when the tree is send from the server in a serialized form,
|
||||
// the bigints are converted to strings and I can't figure out how to use tree.import to load bigints there
|
||||
function findIndexInTree(tree: LeanIMT, commitment: bigint): number {
|
||||
export function findIndexInTree(tree: LeanIMT, commitment: bigint): number {
|
||||
let index = tree.indexOf(commitment);
|
||||
if (index === -1) {
|
||||
index = tree.indexOf(commitment.toString() as unknown as bigint);
|
||||
|
||||
Reference in New Issue
Block a user