Skip to content

Replace ed25519-dalek::Signature#143

Open
emhane wants to merge 2 commits into
JamiiDao:masterfrom
emhane:replace-sdk-hash
Open

Replace ed25519-dalek::Signature#143
emhane wants to merge 2 commits into
JamiiDao:masterfrom
emhane:replace-sdk-hash

Conversation

@emhane

@emhane emhane commented Mar 9, 2026

Copy link
Copy Markdown

Closes #142

  • Replaces use of ed25519-dalek::Signature with solana_singature::Signature
  • Fixes compilation bug on rustc 1.93.0, caused by derive Default for nested type web_sys::js_sys::Function

@emhane emhane changed the title Replace sdk hash Replace ed25519-dalek::Signature Mar 9, 2026

@448-OG 448-OG left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@448-OG 448-OG Mar 9, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@448-OG

448-OG commented Mar 9, 2026

Copy link
Copy Markdown
Member

I couldn't find the compilation bug you say for rust 1.93.0 for commit 0e8042d:

Running 1.93.0:

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

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.

Use solana_signature::Signature

2 participants