tomusdrw / rust-web3

Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library. ENS address: rust-web3.eth
MIT License
1.46k stars 470 forks source link

Add wasm support to transports::Either #703

Closed platonfloria closed 2 months ago

platonfloria commented 1 year ago

Issue: 'the trait web3::Transport is not implemented for `web3::transports::Either' when used in wasm.

Reason: wasm Futures do not implement Send, that is required for Transport implementation of Either. See https://github.com/rustwasm/wasm-bindgen/issues/2833

Solution: Remove Send requirement for wasm implementation by using LocalBoxFuture.

platonfloria commented 5 months ago

Can you elaborate why the transport does not work in wasm currently? I have to admit I don't fully understand neither the problem nor the solution, so would appreciate some insights in the PR description.

Done