-
Notifications
You must be signed in to change notification settings - Fork 41
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
Simplify nodejs and wasm bindings p. 2 #1146
Simplify nodejs and wasm bindings p. 2 #1146
Conversation
const getSecretManagerFromWallet = ( | ||
method: WalletMethodHandler, | ||
): SecretManagerMethodHandler => { | ||
// TODO figure out why this one is extensible but client isnt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea i cannot figure this one out unfortunately, should i make a ticket or do we accept this solution? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the problem exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SecretManagerMethodHandler constructor checks the type it receives, if its extensible, its a config/serialized info. if not, its a rust object, and its ready for use. However, for some reason the SecretManagerMethodHandler we return in wasm is diffferent from the nodejs one, and is extensible, causing it to crash. (trying to deserialize a rust pointer)
Thats why here i intercept the wasm method and just force "not extensible". it works :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(probably because nodejs returns Arc<>, but we cant do that in wasm as its not implementing some trait (i forgot which, some wasm stuff)
* unify error handling and responses * wasm * its something * secret manager alignment * error on callback fix * listen error in wasm, madelisten async again
* simplify nodejs client and wallet * got -> was * fixed client on node side * wasm * removed await for client * lint n format * fixed test and client error return * fixed error and comment * Simplify nodejs and wasm bindings p. 2 (#1146) * unify error handling and responses * wasm * its something * secret manager alignment * error on callback fix * listen error in wasm, madelisten async again * final changes * removed unused PromiseString * lint * wasm update * nodejs * removed async closure * nodejs fixed with tests * fmt * some fixes * mqtt * rewrite again eh :D * client.create() * format and fmt * review and 8050 * typo * updated error handling in nodejs once again * wasm destroy rename * Update bindings/nodejs/lib/index.ts Co-authored-by: DaughterOfMars <[email protected]> * secret manager create * typo grrr * forgot to rename create methods * Done more comment explaining :D * removed mqtt custom serde * wasm fixes * fix tests * fmt * fixed secret * promise await * fixed errors, separate eslint * wasm side * typo --------- Co-authored-by: Alex Coats <[email protected]> Co-authored-by: Thibault Martinez <[email protected]> Co-authored-by: /alex/ <[email protected]> Co-authored-by: Thoralf-M <[email protected]>
====
This merges into the original to show the difference
Please discuss below ;)
Changes:
èrrorHandler
, making parsing on 1 spotQuestions:
iota-sdk/bindings/wasm/lib/bindings.ts
Line 27 in 25d9aa4
Todo:
Heres my beautifull design incase youre wondering how it all stitches together