From b0d00cf7ea666216a1d154d6c7b9882305ccbf1c Mon Sep 17 00:00:00 2001
From: akildemir <akildemir72@gmail.com>
Date: Mon, 28 Oct 2024 12:41:39 +0300
Subject: [PATCH] fix machete & dex quote price api

---
 Cargo.lock                      | 1 -
 substrate/dex/pallet/src/lib.rs | 6 +++---
 substrate/node/Cargo.toml       | 1 -
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 93d5bd752..bf320e6fa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8380,7 +8380,6 @@ dependencies = [
  "schnorrkel",
  "serai-env",
  "serai-runtime",
- "serde",
  "sp-api",
  "sp-block-builder",
  "sp-blockchain",
diff --git a/substrate/dex/pallet/src/lib.rs b/substrate/dex/pallet/src/lib.rs
index 6d8139912..71d105496 100644
--- a/substrate/dex/pallet/src/lib.rs
+++ b/substrate/dex/pallet/src/lib.rs
@@ -1007,9 +1007,9 @@ pub mod pallet {
         return None;
       }
 
-      let path = if coin1 == Coin::native() {
-        vec![coin2, coin1]
-      } else if coin2 == Coin::native() {
+      let path = if (coin1 == Coin::native() && coin2 != Coin::native()) ||
+        (coin2 == Coin::native() && coin1 != Coin::native())
+      {
         vec![coin1, coin2]
       } else {
         vec![coin1, Coin::native(), coin2]
diff --git a/substrate/node/Cargo.toml b/substrate/node/Cargo.toml
index 1e177d1fb..4ab04fde0 100644
--- a/substrate/node/Cargo.toml
+++ b/substrate/node/Cargo.toml
@@ -49,7 +49,6 @@ tokio = { version = "1", features = ["sync", "rt-multi-thread"] }
 jsonrpsee = { version = "0.16", features = ["server"] }
 
 scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
-serde = { version = "1", default-features = false, features = ["derive", "alloc"] }
 
 sc-offchain = { git = "https://github.com/serai-dex/substrate" }
 sc-transaction-pool = { git = "https://github.com/serai-dex/substrate" }