-
Notifications
You must be signed in to change notification settings - Fork 97
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
Fix MM2 compilation errors for wasm32 arch #841
Conversation
sergeyboyko0791
commented
Mar 2, 2021
- Remove "native" and "w-bindgen" features from toml files, replace the compilation conditions that depend on these features with target_arch = "wasm32"
- Remove feature = "native" from toml files, replace it with target_arch = "wasm32"
- Remove '--features native' from CI scripts
* Fix the 'unused_variable' warnings while using mm_metrics in wasm mode
* Add mm2_libp2p::runtime module * TODO pass a Js transport to the libp2p::wasm_ext::ExtTransport::new * TODO configure SwarmRuntime for wasm32 arch
* Replace feature = "native" with target_arch = "wasm32" in the remaining modules
* Replace feature = "w-bindgen" with target_arch = "wasm32"
* Replace eth::eth_tests::wasm_bindgen_tests into eth::eth_wasm_tests * Fix utxo_tests compilation errors on `cargo test --target wasm32-unknown-unknown --package coins`
* Add independent common::log::LogLevel enum * Add for_tests::require_log_level, use it in mm2_tests::test_best_orders # Conflicts: # mm2src/coins/Cargo.toml # mm2src/coins/eth/eth_tests.rs # mm2src/coins/utxo/rpc_clients.rs # mm2src/common/Cargo.toml # mm2src/common/build.rs # mm2src/common/common.rs # mm2src/common/for_tests.rs # mm2src/common/mm_metrics/native.rs # mm2src/lp_network.rs # mm2src/lp_ordermatch.rs # mm2src/mm2_tests.rs # mm2src/rpc.rs
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.
I just left a few comments to accommodate them.
@@ -3,27 +3,26 @@ | |||
//! Sometimes we need to call downstream, from a dependency and into a dependent crate, | |||
//! such as when calling `mm2::rpc::process_rpc_request` from `common::MarketMakerIt::rpc`. | |||
//! Here we can use C-like headers and/or constructible slots for that. | |||
//! | |||
//! TODO refactor this. |
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.
This TODO refers to the following comment.
|
||
/// Access to `rpc::process_rpc_request` defined downstream. | ||
/// Initialized in `rpc::init_header_slots`. | ||
#[cfg(not(feature = "native"))] | ||
|
||
pub static RPC_SERVICE: Constructible< |
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.
I suggest refactoring the RPC_SERVICE
somehow in the next iteration. It's just why I left the TODO above.
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.
Great work on this! Just a couple of changes 🙂
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.
1 more minor change 🙂
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.
Great job, thanks! 🔥