Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imported group.indexOf not work #847

Closed
tochy-open opened this issue Aug 6, 2024 · 1 comment · Fixed by #850
Closed

imported group.indexOf not work #847

tochy-open opened this issue Aug 6, 2024 · 1 comment · Fixed by #850
Assignees
Labels
bug 🐛 Something isn't working

Comments

@tochy-open
Copy link

Describe the bug
After group imported, members return string[]
indexOf function always return -1

To Reproduce
Steps to reproduce the behavior:

const group_origin = new Group([1n, 2n, 3n, 4n, 5n])
const exported = group_origin.export()
console.log('group test', group_origin.members)
console.log(group_origin.indexOf(3n))
console.log(group_origin.indexOf('3'))
console.log(group_origin.indexOf(BigInt('3')))
console.log(group_origin.members.indexOf(3n))
console.log(group_origin.members.indexOf(BigInt('3')))

const group = Group.import(exported)
console.log('group imported', group.members)
console.log(group.indexOf(3n))
console.log(group.indexOf('3'))
console.log(group.indexOf(BigInt('3')))
console.log(group.members.indexOf(3n))
console.log(group.members.indexOf(BigInt('3')))

const converted = group.members.map(id => id.toString())
console.log('members bigint[] to string[]')
console.log(converted.indexOf('3'))

Expected behavior
imported group.indexOf return correct position

Screenshots

Screenshot 2024-08-06 at 2 29 17 PM

@tochy-open tochy-open added the bug 🐛 Something isn't working label Aug 6, 2024
@cedoor cedoor self-assigned this Aug 7, 2024
@cedoor cedoor moved this to 🏗 In Progress in Semaphore Board Aug 7, 2024
@cedoor
Copy link
Member

cedoor commented Aug 7, 2024

Thanks @tochy-open 🙏🏽 WIP

Re: privacy-scaling-explorations/zk-kit#313

@cedoor cedoor moved this from 🏗 In Progress to 👀 In review in Semaphore Board Aug 12, 2024
cedoor added a commit that referenced this issue Aug 12, 2024
cedoor added a commit that referenced this issue Aug 12, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✔️ Done in Semaphore Board Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

2 participants