Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've added the wasm bindings for
set_root_key_id
as well as a test to ensure it works.Currently the errors aren't being handled as far as I can tell. I assume if you pass the native function a string instead of an int you get a type error, but in the current implementation it seems to set the root key id to 0.
I was unable to chain the error mapping method that most of the other bindings seem to be using:
Would give the following compiler/rust analyzer error:
I did make it work the following way:
But I wasn't sure if this is redundant without an accompanying
Err
statement. I certainly couldn't see any other methods constructed this way. I assume theJsValue
refers to the way thatwasm-bindgen
returns the rust errors to javascript, but I'm not sure exactly how to make that happen without themap_err
method chain.Having said that I'm probably just missing something very obvious, so let me know and I'll make the relevant change.
I also notice my javascript formatter config disagrees with yours, if you let me know exactly what you're using (some kind of global prettier config?) I will try to match it and avoid inconsistencies.