@@ -20,15 +20,10 @@ pub static RESERVED_NATIVE_FEES: LazyLock<HashMap<Chain, &'static str>> = LazyLo
2020 ( Chain :: Solana , "20000" ) , // 0.00002 SOL
2121 ( Chain :: Ton , "20000000" ) , // 0.02 TON
2222 ( Chain :: Tron , "20000000" ) , // 20 TRX
23- ( Chain :: Bitcoin , "40000" ) , // 0.0004 BTC
24- ( Chain :: Zcash , "1000000" ) , // 0.01 ZEC
25- ( Chain :: Doge , "500000000" ) , // 5 DOGE
2623 ( Chain :: Xrp , "2000000" ) , // 2 XRP
2724 ( Chain :: Cardano , "2000000" ) , // 2 ADA
2825 ( Chain :: Aptos , "20000000" ) , // 0.2 APT
2926 ( Chain :: Stellar , "100000" ) , // 0.01 XLM
30- ( Chain :: Litecoin , "100000" ) , // 0.001 LTC
31- ( Chain :: BitcoinCash , "100000" ) , // 0.001 BCH
3227 ( Chain :: Monad , "5000000000000000" ) , // 0.005 MON
3328 ( Chain :: XLayer , "5000000000000000" ) , // 0.005 OKB
3429 ( Chain :: Plasma , "5000000000000000" ) , // 0.005 XPL
@@ -65,3 +60,36 @@ pub fn quote_value_after_reserve_by_chain(request: &QuoteRequest) -> Result<Stri
6560 } ;
6661 quote_value_after_reserve ( request, reserved)
6762}
63+
64+ #[ cfg( test) ]
65+ mod tests {
66+ use primitives:: AssetId ;
67+
68+ use super :: * ;
69+ use crate :: { Options , SwapperQuoteAsset } ;
70+
71+ #[ test]
72+ fn btc_family_chains_have_no_reserve ( ) {
73+ // UTXO chains do not need swapper-side reserves; the signer subtracts fees from selected inputs.
74+ for chain in [ Chain :: Bitcoin , Chain :: Litecoin , Chain :: BitcoinCash , Chain :: Doge , Chain :: Zcash ] {
75+ assert_eq ! ( reserved_tx_fees( chain) , None , "{chain:?} should not be in the reserve table" ) ;
76+ }
77+ }
78+
79+ #[ test]
80+ fn btc_max_quote_passes_value_through ( ) {
81+ let request = QuoteRequest {
82+ from_asset : SwapperQuoteAsset :: from ( AssetId :: from_chain ( Chain :: Bitcoin ) ) ,
83+ to_asset : SwapperQuoteAsset :: from ( AssetId :: from_chain ( Chain :: Solana ) ) ,
84+ wallet_address : "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4" . into ( ) ,
85+ destination_address : "11111111111111111111111111111111" . into ( ) ,
86+ value : "89100" . to_string ( ) ,
87+ options : Options {
88+ use_max_amount : true ,
89+ ..Default :: default ( )
90+ } ,
91+ } ;
92+
93+ assert_eq ! ( quote_value_after_reserve_by_chain( & request) . unwrap( ) , "89100" ) ;
94+ }
95+ }
0 commit comments