Skip to content

[BUG]: Poseidon Hash Example Rust bindings  #651

@AustinLiu01

Description

@AustinLiu01

Description

Your developer manual says that using Poseidon Hash's API is as follows:
It suggests that you should instantiate a poseidon_hasher as follows
let poseidon_hasher = Poseidon::new::<ScalarField>(arity as u32).unwrap();
But actually I got an error:

error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> src/main.rs:114:27
    |
114 |     let poseidon_hasher = Poseidon::new::<ScalarField>(arity as u32).unwrap();
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------- an argument of type'Option<&Field<1, ScalarCfg>> is missing
    |
note: associated function defined here
   --> (my_address)/wrappers/rust/icicle-core/src/poseidon/mod.rs:27:12
    |
27  |     pub fn new<F>(t: u32, domain_tag: Option<&F>) -> Result<Hasher, eIcicleError>
    |            ^^^
help: provide the argument
    |
114 |     let poseidon_hasher = Poseidon::new::<ScalarField>(arity as u32, /* Option<&Field<1, ScalarCfg>> */).unwrap();
    |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When I checked my local as well as the github repo on the this path:
icicle/wrappers/rust/icicle-core/src/poseidon/mod.rs
There is a problem reported by the compiler, I would like to request the official update for this API, thank you!

Reproduce

Just run the example rust bindings in your developer manual.

Expected Behavior

Work

Environment

Please complete the following information:

OS + Version: Centos 7

Cargo Version: 1.80

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions