Replace ed25519-dalek::Signature#143
Conversation
448-OG
left a comment
There was a problem hiding this comment.
Remember to squash your commits into one
| .or(Err(WalletUtilsError::InvalidSignature)) | ||
| signature | ||
| .verify(public_key.as_bytes(), message_bytes) | ||
| .then_some(()) // todo: rm once stable https://github.com/rust-lang/rust/issues/142748 |
There was a problem hiding this comment.
Isn't then_some stable? I don't understand the comment.
https://doc.rust-lang.org/nightly/src/core/bool.rs.html#33
| version: SemverVersion::default(), | ||
| legacy: false, | ||
| version_zero: false, | ||
| callback: noop(), |
There was a problem hiding this comment.
The callback is required and fetched from the wallet that is injecting the code to the browser. Therefore, noop() is invalid for this. I would suggest you just drop the derive Default implementation
| fn default() -> Self { | ||
| Self { | ||
| version: SemverVersion::default(), | ||
| callback: noop(), |
There was a problem hiding this comment.
Same thing here, some standard functions require callbacks from the wallet that is injecting the code into the browser as specified in the wallet adapter implementation. So noop is not valid if the function is just a dummy one
|
I couldn't find the compilation bug you say for rust 1.93.0 for commit 0e8042d: Running root@d90fd36c0ca2:/workspaces/SolanaWalletAdapter# rustup +1.93.0 target add wasm32-unknown-unknown
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
root@d90fd36c0ca2:/workspaces/SolanaWalletAdapter# cargo +1.93.0 build --target wasm32-unknown-unknown
Compiling proc-macro2 v1.0.106
...
Compiling wallet-standard-base v0.2.0 (/workspaces/SolanaWalletAdapter/base)
Compiling web-sys v0.3.82
Compiling wasm-bindgen-futures v0.4.55
Compiling wallet-adapter v1.4.2 (/workspaces/SolanaWalletAdapter/crate)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 13.22s |
Closes #142
ed25519-dalek::Signaturewithsolana_singature::SignatureDefaultfor nested typeweb_sys::js_sys::Function