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

bug(rln): Type mismatch in witness json serialisation and deserialisation functions #252

Closed
seemenkina opened this issue May 20, 2024 · 1 comment
Assignees

Comments

@seemenkina
Copy link
Contributor

The serialisation and deserialisation functions have problems with json field types because all value are serialized as string and deserialize required number value. And test function cover only deserialisation on constant value

Serialisation to String:

zerokit/rln/src/protocol.rs

Lines 775 to 777 in fe2b224

for v in rln_witness.path_elements.iter() {
path_elements.push(to_bigint(v)?.to_str_radix(10));
}

Deserialisation from u64 :

zerokit/rln/src/protocol.rs

Lines 247 to 248 in fe2b224

for v in identity_path_index_array {
identity_path_index.push(v.as_u64().ok_or(Report::msg("not a u64 value"))? as u8);

@rymnc
Copy link
Contributor

rymnc commented May 21, 2024

addressed in #253

@rymnc rymnc closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants