Skip to content

Conversation

@bleepbloopsify
Copy link
Contributor

adding a canary value so we can ensure the e2e flow works

// fp

#[napi]
#[napi(js_name = "caml_pasta_fp_poseidon_block_cipher")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm actually is this the right format or should it be camel case in the napi annotation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tells napi what name to use when exporting to js-land

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was asking because when I was doing the plonk-wasm overrides for the first time, I had to create this snakeToCamel function in node_backend.js so that the function names coming from rust (in snake case) were mapped to camel case. So that makes me wonder if we could replace that whole function by just using #[napi(js_name = "camlPastaFpPoseidonBlockCipher")] in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we don't need the snakeToCamel function if we do this here

Napi chooses to "snakeCase" your rust symbols by default, if we explicitly tell napi what name to give it, it will end up with this one guaranteed

@bleepbloopsify
Copy link
Contributor Author

closing this because #3357 is way better

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

Successfully merging this pull request may close these issues.

3 participants