Skip to content

chore(core): adapt MmError and usages for compatibility with new rustc versions#2443

Merged
shamardy merged 21 commits intodevfrom
prepare-mm-err-for-newer-rustc
Jun 26, 2025
Merged

chore(core): adapt MmError and usages for compatibility with new rustc versions#2443
shamardy merged 21 commits intodevfrom
prepare-mm-err-for-newer-rustc

Conversation

@borngraced
Copy link
Copy Markdown

Recent Rust compiler updates have tightened coherence rules, causing our blanket From<MmError> for MmError conversions to break. Instead of refactoring the core MmError type, this PR applies a minimal, mechanical change: it inserts calls to our new .map_mm_err() helper before each ? where the conversion would fail.

No changes to business logic or public API 100% an internal compatibility update

@borngraced borngraced self-assigned this May 6, 2025
@dimxy
Copy link
Copy Markdown
Collaborator

dimxy commented May 13, 2025

Great work to fix a systemic problem, due to new language version compatibility issues.
(When we switch to new rustc I could use the latest rust analyser!)

@dimxy
Copy link
Copy Markdown
Collaborator

dimxy commented May 13, 2025

I am okay with this PR (when conflicts are resolved).

it's good to update sample code in the docs in mm_error.rs

dimxy
dimxy previously approved these changes May 14, 2025
Copy link
Copy Markdown
Collaborator

@dimxy dimxy left a comment

Choose a reason for hiding this comment

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

LGTM

dimxy
dimxy previously approved these changes May 27, 2025
Copy link
Copy Markdown
Collaborator

@dimxy dimxy left a comment

Choose a reason for hiding this comment

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

LGTM

onur-ozkan
onur-ozkan previously approved these changes Jun 25, 2025
Copy link
Copy Markdown

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

CI tests are passing as expected and changes looks good.

@shamardy shamardy merged commit 258feab into dev Jun 26, 2025
17 of 24 checks passed
@shamardy shamardy deleted the prepare-mm-err-for-newer-rustc branch June 26, 2025 03:01
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Jun 27, 2025
* dev: (30 commits)
  chore(core): replace hash_raw_entry with stable entry() API (GLEECBTC#2473)
  chore(core): adapt `MmError` and usages for compatibility with new rustc versions (GLEECBTC#2443)
  feat(wallet): add `delete_wallet` RPC (GLEECBTC#2497)
  chore(release): add changelog entries for v2.5.0-beta (GLEECBTC#2494)
  chore(release): bump kdf version to 2.5.0-beta (GLEECBTC#2492)
  feat(tests): zcoin unit test to validate dex fee (GLEECBTC#2460)
  fix(zcoin): correctly track unconfirmed z-coin notes (GLEECBTC#2331)
  improvement(orders): remove BTC specific volume from min_trading_vol logic (GLEECBTC#2483)
  feat(ibc-routing-part-2): supporting entire Cosmos network for swaps (GLEECBTC#2476)
  fix(startup): don't initialize WalletConnect during startup (GLEECBTC#2485)
  fix(dns): better ip resolution (GLEECBTC#2487)
  improvement(event-streaming): strong type streamer IDs (GLEECBTC#2441)
  bump timed-map to `1.4.1` (GLEECBTC#2481)
  improvement(RPC): unified interface for legacy and current RPC interfaces (GLEECBTC#2450)
  improvement(tendermint): `tendermint_tx_internal_id` helper (GLEECBTC#2438)
  feat(walletconnect): add WalletConnect v2 support for EVM and Cosmos (GLEECBTC#2223)
  feat(ibc-routing-part-1): supporting entire Cosmos network for swaps (GLEECBTC#2459)
  fix(test): fix HD Wallet message signing tests (GLEECBTC#2474)
  improvement(builds): enable static CRT linking for MSVC builds (GLEECBTC#2464)
  feat(wallet): implement HD multi-address support for message signing (GLEECBTC#2432)
  ...

# Conflicts:
#	mm2src/coins/qrc20.rs
#	mm2src/mm2_main/src/lp_swap/maker_swap.rs
dimxy pushed a commit that referenced this pull request Jun 27, 2025
* dev:
  chore(core): replace hash_raw_entry with stable entry() API (#2473)
  chore(core): adapt `MmError` and usages for compatibility with new rustc versions (#2443)
  feat(wallet): add `delete_wallet` RPC (#2497)
  chore(release): add changelog entries for v2.5.0-beta (#2494)
  chore(release): bump kdf version to 2.5.0-beta (#2492)
  feat(tests): zcoin unit test to validate dex fee (#2460)

# Conflicts:
#	mm2src/coins/qrc20.rs
#	mm2src/mm2_main/src/lp_swap/maker_swap.rs
shamardy added a commit that referenced this pull request Jul 1, 2025
onur-ozkan pushed a commit that referenced this pull request Jul 1, 2025
* post merge fix: After merging staging into dev, there were compilation errors due to #2443, this fixes it

* review fix: Improve error handling with `.into()`
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Jul 16, 2025
* refactor-gas-fee-policy: (30 commits)
  revert change in test_enable_custom_erc20
  fix(test) disable get_swap_gas_fee_policy for tests (no platform coin in tests)
  revert tokio test and use block_on for eth docker test
  Refactor gas fee code: get max_eth_tx_type from platform coin, add gas fee adjust coin params, rename "set_swap_transaction_fee_policy" rpc to "set_swap_gas_fee_policy", force set_swap_gas_fee_policy to store policy in the platform coin
  fix(eth): Propagate structured EIP-1559 fee errors (GLEECBTC#2532)
  fix(eth): Correctly implement ETH max withdrawal logic (GLEECBTC#2531)
  feat(use-clap-for-cli): use clap to parse CLI-Args GLEECBTC#2215 (GLEECBTC#2510)
  feat(orderbook): expirable maker orders (GLEECBTC#2516)
  improvement(eth): drop parity support (GLEECBTC#2527)
  chore(release): finalize changelog for v2.5.0-beta (GLEECBTC#2524)
  chore(toolchain): upgrade toolchain to nightly 1.86.0 (GLEECBTC#2444)
  feat(swap): rpc to find best swap with liquidity routing for ask (GLEECBTC#2362)
  fix(kdf_walletconnect): apply explicit MmError mapping (GLEECBTC#2514)
  fix(walletconnect): centralize connection and retry logic (GLEECBTC#2508)
  fix(hw-wallet): avoid calling `get_enabled_address` in trezor-based coin init (GLEECBTC#2504)
  chore(core): replace hash_raw_entry with stable entry() API (GLEECBTC#2473)
  chore(core): adapt `MmError` and usages for compatibility with new rustc versions (GLEECBTC#2443)
  feat(wallet): add `delete_wallet` RPC (GLEECBTC#2497)
  chore(release): add changelog entries for v2.5.0-beta (GLEECBTC#2494)
  chore(release): bump kdf version to 2.5.0-beta (GLEECBTC#2492)
  ...

# Conflicts:
#	mm2src/coins/eth.rs
#	mm2src/coins/eth/eth_swap_v2/eth_maker_swap_v2.rs
#	mm2src/coins/eth/eth_swap_v2/eth_taker_swap_v2.rs
#	mm2src/coins/eth/eth_utils.rs
#	mm2src/coins/eth/eth_withdraw.rs
#	mm2src/coins/eth/v2_activation.rs
#	mm2src/coins/lp_coins.rs
#	mm2src/coins/qrc20.rs
#	mm2src/coins/qrc20/swap.rs
#	mm2src/coins_activation/src/platform_coin_with_tokens.rs
#	mm2src/coins_activation/src/token.rs
#	mm2src/mm2_main/src/lp_swap/check_balance.rs
#	mm2src/mm2_main/src/lp_swap/maker_swap.rs
#	mm2src/mm2_main/src/rpc/dispatcher/dispatcher.rs
#	mm2src/mm2_main/src/rpc/lp_commands/ext_api/ext_api_types.rs
#	mm2src/mm2_main/src/rpc/lp_commands/mod.rs
#	mm2src/mm2_main/src/rpc/lp_commands/one_inch/errors.rs
#	mm2src/mm2_main/src/rpc/lp_commands/one_inch/rpcs.rs
#	mm2src/mm2_main/src/rpc/lp_commands/tokens.rs
#	mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
#	mm2src/trading_api/src/one_inch_api/classic_swap_types.rs
#	mm2src/trading_api/src/one_inch_api/client.rs
#	mm2src/trading_api/src/one_inch_api/portfolio_types.rs
dimxy pushed a commit that referenced this pull request Oct 15, 2025
…stc versions (#2443)

Recent Rust compiler updates have tightened coherence rules, causing the blanket From<MmError> for MmError conversions to break. Instead of refactoring the core MmError type, this commit applies a minimal, mechanical change: it inserts calls to the new .map_mm_err() helper before each ? where the conversion would fail.

No changes to business logic or public API 100% an internal compatibility update
dimxy pushed a commit that referenced this pull request Oct 15, 2025
* post merge fix: After merging staging into dev, there were compilation errors due to #2443, this fixes it

* review fix: Improve error handling with `.into()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants