Skip to content

Commit a19e442

Browse files
author
dimxy
authored
feat(utxo): add new fixed txfee option for DINGO-like coins (#2454)
This commit make txsize not round up by default. It then adds a new fixed tx fee option "dingo_fee"=true, with rounding up, that could be set for a coin in the coins file.
1 parent 5b2d8d1 commit a19e442

34 files changed

+475
-324
lines changed

mm2src/coins/eth.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5987,7 +5987,6 @@ impl MmCoin for EthCoin {
59875987
&self,
59885988
value: TradePreimageValue,
59895989
stage: FeeApproxStage,
5990-
include_refund_fee: bool,
59915990
) -> TradePreimageResult<TradeFee> {
59925991
let pay_for_gas_option = self
59935992
.get_swap_pay_for_gas_option(self.get_swap_transaction_fee_policy())
@@ -5997,7 +5996,7 @@ impl MmCoin for EthCoin {
59975996
let gas_limit = match self.coin_type {
59985997
EthCoinType::Eth => {
59995998
// this gas_limit includes gas for `ethPayment` and optionally `senderRefund` contract calls
6000-
if include_refund_fee {
5999+
if matches!(stage, FeeApproxStage::OrderIssueMax | FeeApproxStage::TradePreimageMax) {
60016000
U256::from(self.gas_limit.eth_payment) + U256::from(self.gas_limit.eth_sender_refund)
60026001
} else {
60036002
U256::from(self.gas_limit.eth_payment)
@@ -6027,7 +6026,7 @@ impl MmCoin for EthCoin {
60276026
gas += approve_gas_limit;
60286027
}
60296028
// add 'senderRefund' gas if requested
6030-
if include_refund_fee {
6029+
if matches!(stage, FeeApproxStage::TradePreimage | FeeApproxStage::TradePreimageMax) {
60316030
gas += U256::from(self.gas_limit.erc20_sender_refund);
60326031
}
60336032
gas
@@ -6808,10 +6807,10 @@ fn increase_gas_price_by_stage(pay_for_gas_option: PayForGasOption, level: &FeeA
68086807
FeeApproxStage::StartSwap => {
68096808
increase_by_percent_one_gwei(gas_price, GAS_PRICE_APPROXIMATION_PERCENT_ON_START_SWAP)
68106809
},
6811-
FeeApproxStage::OrderIssue => {
6810+
FeeApproxStage::OrderIssue | FeeApproxStage::OrderIssueMax => {
68126811
increase_by_percent_one_gwei(gas_price, GAS_PRICE_APPROXIMATION_PERCENT_ON_ORDER_ISSUE)
68136812
},
6814-
FeeApproxStage::TradePreimage => {
6813+
FeeApproxStage::TradePreimage | FeeApproxStage::TradePreimageMax => {
68156814
increase_by_percent_one_gwei(gas_price, GAS_PRICE_APPROXIMATION_PERCENT_ON_TRADE_PREIMAGE)
68166815
},
68176816
FeeApproxStage::WatcherPreimage => {

mm2src/coins/eth/eth_tests.rs

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -331,34 +331,26 @@ fn get_sender_trade_preimage() {
331331
let actual = block_on(coin.get_sender_trade_fee(
332332
TradePreimageValue::UpperBound(150.into()),
333333
FeeApproxStage::WithoutApprox,
334-
true,
335334
))
336335
.expect("!get_sender_trade_fee");
337-
let expected = expected_fee(GAS_PRICE, gas_limit::ETH_PAYMENT + gas_limit::ETH_SENDER_REFUND);
336+
let expected = expected_fee(GAS_PRICE, gas_limit::ETH_PAYMENT);
338337
assert_eq!(actual, expected);
339338

340339
let value = u256_to_big_decimal(100.into(), 18).expect("!u256_to_big_decimal");
341-
let actual =
342-
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::OrderIssue, true))
343-
.expect("!get_sender_trade_fee");
344-
let expected = expected_fee(
345-
GAS_PRICE_APPROXIMATION_ON_ORDER_ISSUE,
346-
gas_limit::ETH_PAYMENT + gas_limit::ETH_SENDER_REFUND,
347-
);
340+
let actual = block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::OrderIssue))
341+
.expect("!get_sender_trade_fee");
342+
let expected = expected_fee(GAS_PRICE_APPROXIMATION_ON_ORDER_ISSUE, gas_limit::ETH_PAYMENT);
348343
assert_eq!(actual, expected);
349344

350345
let value = u256_to_big_decimal(1.into(), 18).expect("!u256_to_big_decimal");
351-
let actual = block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::StartSwap, true))
346+
let actual = block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::StartSwap))
352347
.expect("!get_sender_trade_fee");
353-
let expected = expected_fee(
354-
GAS_PRICE_APPROXIMATION_ON_START_SWAP,
355-
gas_limit::ETH_PAYMENT + gas_limit::ETH_SENDER_REFUND,
356-
);
348+
let expected = expected_fee(GAS_PRICE_APPROXIMATION_ON_START_SWAP, gas_limit::ETH_PAYMENT);
357349
assert_eq!(actual, expected);
358350

359351
let value = u256_to_big_decimal(10000000000u64.into(), 18).expect("!u256_to_big_decimal");
360352
let actual =
361-
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::TradePreimage, true))
353+
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::TradePreimageMax))
362354
.expect("!get_sender_trade_fee");
363355
let expected = expected_fee(
364356
GAS_PRICE_APPROXIMATION_ON_TRADE_PREIMAGE,
@@ -405,58 +397,46 @@ fn get_erc20_sender_trade_preimage() {
405397
// value is allowed
406398
unsafe { ALLOWANCE = 1000 };
407399
let value = u256_to_big_decimal(1000.into(), 18).expect("u256_to_big_decimal");
408-
let actual = block_on(coin.get_sender_trade_fee(
409-
TradePreimageValue::UpperBound(value),
410-
FeeApproxStage::WithoutApprox,
411-
true,
412-
))
413-
.expect("!get_sender_trade_fee");
400+
let actual =
401+
block_on(coin.get_sender_trade_fee(TradePreimageValue::UpperBound(value), FeeApproxStage::WithoutApprox))
402+
.expect("!get_sender_trade_fee");
414403
log!("{:?}", actual.amount.to_decimal());
415404
unsafe { assert!(!ESTIMATE_GAS_CALLED) }
416-
assert_eq!(
417-
actual,
418-
expected_trade_fee(gas_limit::ERC20_PAYMENT + gas_limit::ERC20_SENDER_REFUND, GAS_PRICE)
419-
);
405+
assert_eq!(actual, expected_trade_fee(gas_limit::ERC20_PAYMENT, GAS_PRICE));
420406

421407
// value is greater than allowance
422408
unsafe { ALLOWANCE = 999 };
423409
let value = u256_to_big_decimal(1000.into(), 18).expect("u256_to_big_decimal");
424-
let actual =
425-
block_on(coin.get_sender_trade_fee(TradePreimageValue::UpperBound(value), FeeApproxStage::StartSwap, true))
426-
.expect("!get_sender_trade_fee");
410+
let actual = block_on(coin.get_sender_trade_fee(TradePreimageValue::UpperBound(value), FeeApproxStage::StartSwap))
411+
.expect("!get_sender_trade_fee");
427412
unsafe {
428413
assert!(ESTIMATE_GAS_CALLED);
429414
ESTIMATE_GAS_CALLED = false;
430415
}
431416
assert_eq!(
432417
actual,
433418
expected_trade_fee(
434-
gas_limit::ERC20_PAYMENT + gas_limit::ERC20_SENDER_REFUND + APPROVE_GAS_LIMIT,
419+
gas_limit::ERC20_PAYMENT + APPROVE_GAS_LIMIT,
435420
GAS_PRICE_APPROXIMATION_ON_START_SWAP
436421
)
437422
);
438423

439424
// value is allowed
440425
unsafe { ALLOWANCE = 1000 };
441426
let value = u256_to_big_decimal(999.into(), 18).expect("u256_to_big_decimal");
442-
let actual =
443-
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::OrderIssue, true))
444-
.expect("!get_sender_trade_fee");
427+
let actual = block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::OrderIssue))
428+
.expect("!get_sender_trade_fee");
445429
unsafe { assert!(!ESTIMATE_GAS_CALLED) }
446430
assert_eq!(
447431
actual,
448-
expected_trade_fee(
449-
gas_limit::ERC20_PAYMENT + gas_limit::ERC20_SENDER_REFUND,
450-
GAS_PRICE_APPROXIMATION_ON_ORDER_ISSUE
451-
)
432+
expected_trade_fee(gas_limit::ERC20_PAYMENT, GAS_PRICE_APPROXIMATION_ON_ORDER_ISSUE)
452433
);
453434

454435
// value is greater than allowance
455436
unsafe { ALLOWANCE = 1000 };
456437
let value = u256_to_big_decimal(1500.into(), 18).expect("u256_to_big_decimal");
457-
let actual =
458-
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::TradePreimage, true))
459-
.expect("!get_sender_trade_fee");
438+
let actual = block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(value), FeeApproxStage::TradePreimage))
439+
.expect("!get_sender_trade_fee");
460440
unsafe {
461441
assert!(ESTIMATE_GAS_CALLED);
462442
ESTIMATE_GAS_CALLED = false;

mm2src/coins/lightning.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,6 @@ impl MmCoin for LightningCoin {
13031303
&self,
13041304
_value: TradePreimageValue,
13051305
_stage: FeeApproxStage,
1306-
_include_refund_fee: bool,
13071306
) -> TradePreimageResult<TradeFee> {
13081307
Ok(TradeFee {
13091308
coin: self.ticker().to_owned(),

mm2src/coins/lp_coins.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,7 @@ impl TransactionDetails {
26272627
}
26282628
}
26292629

2630+
/// Transaction fee to pay for swap transactions (could be total for two transactions: taker fee and payment fee txns)
26302631
#[derive(Clone, Debug, PartialEq, Serialize)]
26312632
pub struct TradeFee {
26322633
pub coin: String,
@@ -2712,6 +2713,8 @@ impl AddAssign for CoinBalance {
27122713
}
27132714

27142715
/// The approximation is needed to cover the dynamic miner fee changing during a swap.
2716+
/// Also used to indicate refund fee is needed for eth
2717+
/// Also used to indicate utxo fee correction is needed due to a possible change output
27152718
#[derive(Clone, Copy, Debug)]
27162719
pub enum FeeApproxStage {
27172720
/// Do not increase the trade fee.
@@ -2722,8 +2725,12 @@ pub enum FeeApproxStage {
27222725
WatcherPreimage,
27232726
/// Increase the trade fee significantly.
27242727
OrderIssue,
2725-
/// Increase the trade fee largely.
2728+
/// Increase the trade fee significantly (used to calculate max volume).
2729+
OrderIssueMax,
2730+
/// Increase the trade fee largely in the trade_preimage rpc.
27262731
TradePreimage,
2732+
/// Increase the trade fee in the trade_preimage rpc (used to calculate max volume for trade preimage).
2733+
TradePreimageMax,
27272734
}
27282735

27292736
#[derive(Debug)]
@@ -3622,7 +3629,6 @@ pub trait MmCoin: SwapOps + WatcherOps + MarketCoinOps + Send + Sync + 'static {
36223629
&self,
36233630
value: TradePreimageValue,
36243631
stage: FeeApproxStage,
3625-
include_refund_fee: bool,
36263632
) -> TradePreimageResult<TradeFee>;
36273633

36283634
/// Get fee to be paid by receiver per whole swap and check if the wallet has sufficient balance to pay the fee.

mm2src/coins/qrc20.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,9 @@ impl Qrc20Coin {
539539
/// or should be sum of gas fee of all contract calls.
540540
pub async fn get_qrc20_tx_fee(&self, gas_fee: u64) -> Result<u64, String> {
541541
match try_s!(self.get_fee_rate().await) {
542-
ActualFeeRate::Dynamic(amount) | ActualFeeRate::FixedPerKb(amount) => Ok(amount + gas_fee),
542+
ActualFeeRate::Dynamic(amount)
543+
| ActualFeeRate::FixedPerKb(amount)
544+
| ActualFeeRate::FixedPerKbDingo(amount) => Ok(amount + gas_fee),
543545
}
544546
}
545547

@@ -1289,7 +1291,6 @@ impl MmCoin for Qrc20Coin {
12891291
&self,
12901292
value: TradePreimageValue,
12911293
stage: FeeApproxStage,
1292-
include_refund_fee: bool,
12931294
) -> TradePreimageResult<TradeFee> {
12941295
let decimals = self.utxo.decimals;
12951296
// pass the dummy params
@@ -1323,7 +1324,7 @@ impl MmCoin for Qrc20Coin {
13231324
};
13241325

13251326
// Optionally calculate refund fee.
1326-
let sender_refund_fee = if include_refund_fee {
1327+
let sender_refund_fee = if matches!(stage, FeeApproxStage::TradePreimage | FeeApproxStage::TradePreimageMax) {
13271328
let sender_refund_output = self
13281329
.sender_refund_output(&self.swap_contract_address, swap_id, value, secret_hash, receiver_addr)
13291330
.map_mm_err()?;

mm2src/coins/qrc20/qrc20_tests.rs

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cfg_native!(
1919
use mocktopus::mocking::{MockResult, Mockable};
2020
);
2121

22-
const EXPECTED_TX_FEE: i64 = 1000;
22+
const DEFAULT_TX_FEE_RATE: i64 = 1000;
2323
const CONTRACT_CALL_GAS_FEE: i64 = (QRC20_GAS_LIMIT_DEFAULT * QRC20_GAS_PRICE_DEFAULT) as i64;
2424
const SWAP_PAYMENT_GAS_FEE: i64 = (QRC20_PAYMENT_GAS_LIMIT * QRC20_GAS_PRICE_DEFAULT) as i64;
2525
const TAKER_PAYMENT_SPEND_SEARCH_INTERVAL: f64 = 1.;
@@ -59,9 +59,9 @@ pub fn qrc20_coin_for_test(priv_key: [u8; 32], fallback_swap: Option<&str>) -> (
5959
(ctx, coin)
6060
}
6161

62-
fn check_tx_fee(coin: &Qrc20Coin, expected_tx_fee: ActualFeeRate) {
63-
let actual_tx_fee = block_on(coin.get_fee_rate()).unwrap();
64-
assert_eq!(actual_tx_fee, expected_tx_fee);
62+
fn check_fee_rate(coin: &Qrc20Coin, expected_fee_rate: ActualFeeRate) {
63+
let actual_fee_rate = block_on(coin.get_fee_rate()).unwrap();
64+
assert_eq!(actual_fee_rate, expected_fee_rate);
6565
}
6666

6767
#[cfg(not(target_arch = "wasm32"))]
@@ -144,7 +144,7 @@ fn test_withdraw_impl_fee_details() {
144144
// 1000 from satoshi,
145145
// where decimals = 8,
146146
// 1000 is fixed fee
147-
"miner_fee": "0.00001",
147+
"miner_fee": "0.00000299",
148148
"gas_limit": 2_500_000,
149149
"gas_price": 40,
150150
// (gas_limit * gas_price) from satoshi in Qtum
@@ -715,12 +715,12 @@ fn test_get_trade_fee() {
715715
172, 110, 180, 13, 123, 179, 10, 49,
716716
];
717717
let (_ctx, coin) = qrc20_coin_for_test(priv_key, None);
718-
// check if the coin's tx fee is expected
719-
check_tx_fee(&coin, ActualFeeRate::FixedPerKb(EXPECTED_TX_FEE as u64));
718+
// check if the coin's tx fee rate is expected
719+
check_fee_rate(&coin, ActualFeeRate::FixedPerKb(DEFAULT_TX_FEE_RATE as u64));
720720

721721
let actual_trade_fee = block_on_f01(coin.get_trade_fee()).unwrap();
722722
let expected_trade_fee_amount = big_decimal_from_sat(
723-
2 * CONTRACT_CALL_GAS_FEE + SWAP_PAYMENT_GAS_FEE + EXPECTED_TX_FEE,
723+
2 * CONTRACT_CALL_GAS_FEE + SWAP_PAYMENT_GAS_FEE + DEFAULT_TX_FEE_RATE,
724724
coin.utxo.decimals,
725725
);
726726
let expected = TradeFee {
@@ -742,20 +742,22 @@ fn test_sender_trade_preimage_zero_allowance() {
742742
231, 153, 202, 20, 238, 120, 64,
743743
];
744744
let (_ctx, coin) = qrc20_coin_for_test(priv_key, None);
745-
// check if the coin's tx fee is expected
746-
check_tx_fee(&coin, ActualFeeRate::FixedPerKb(EXPECTED_TX_FEE as u64));
745+
const EXPECTED_PAYMENT_TX_FEE: i64 = 535;
746+
const EXPECTED_REFUND_TX_FEE: i64 = 396;
747+
// check if the coin's tx fee rate is expected
748+
check_fee_rate(&coin, ActualFeeRate::FixedPerKb(DEFAULT_TX_FEE_RATE as u64));
747749

748750
let allowance = block_on(coin.allowance(coin.swap_contract_address)).expect("!allowance");
749751
assert_eq!(allowance, 0.into());
750752

751753
let erc20_payment_fee_with_one_approve = big_decimal_from_sat(
752-
CONTRACT_CALL_GAS_FEE + SWAP_PAYMENT_GAS_FEE + EXPECTED_TX_FEE,
754+
CONTRACT_CALL_GAS_FEE + SWAP_PAYMENT_GAS_FEE + EXPECTED_PAYMENT_TX_FEE,
753755
coin.utxo.decimals,
754756
);
755-
let sender_refund_fee = big_decimal_from_sat(CONTRACT_CALL_GAS_FEE + EXPECTED_TX_FEE, coin.utxo.decimals);
757+
let sender_refund_fee = big_decimal_from_sat(CONTRACT_CALL_GAS_FEE + EXPECTED_REFUND_TX_FEE, coin.utxo.decimals);
756758

757759
let actual =
758-
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(1.into()), FeeApproxStage::WithoutApprox, true))
760+
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(1.into()), FeeApproxStage::TradePreimageMax)) // pass TradePreimageMax to add change output txfee, to correct the max vol calc
759761
.expect("!get_sender_trade_fee");
760762
// one `approve` contract call should be included into the expected trade fee
761763
let expected = TradeFee {
@@ -778,24 +780,28 @@ fn test_sender_trade_preimage_with_allowance() {
778780
143, 221, 19, 47, 74, 175, 100,
779781
];
780782
let (_ctx, coin) = qrc20_coin_for_test(priv_key, None);
781-
// check if the coin's tx fee is expected
782-
check_tx_fee(&coin, ActualFeeRate::FixedPerKb(EXPECTED_TX_FEE as u64));
783+
const EXPECTED_PAYMENT_WITHOUT_APPROVE_TX_FEE: i64 = 576;
784+
const EXPECTED_PAYMENT_WITH_APPROVES_TX_FEE: i64 = 790;
785+
const EXPECTED_REFUND_TX_FEE: i64 = 544;
786+
// check if the coin's tx fee rate is expected
787+
check_fee_rate(&coin, ActualFeeRate::FixedPerKb(DEFAULT_TX_FEE_RATE as u64));
783788

784789
let allowance = block_on(coin.allowance(coin.swap_contract_address)).expect("!allowance");
785790
assert_eq!(allowance, 300_000_000.into());
786791

787-
let erc20_payment_fee_without_approve =
788-
big_decimal_from_sat(SWAP_PAYMENT_GAS_FEE + EXPECTED_TX_FEE, coin.utxo.decimals);
792+
let erc20_payment_fee_without_approve = big_decimal_from_sat(
793+
SWAP_PAYMENT_GAS_FEE + EXPECTED_PAYMENT_WITHOUT_APPROVE_TX_FEE,
794+
coin.utxo.decimals,
795+
);
789796
let erc20_payment_fee_with_two_approves = big_decimal_from_sat(
790-
2 * CONTRACT_CALL_GAS_FEE + SWAP_PAYMENT_GAS_FEE + EXPECTED_TX_FEE,
797+
2 * CONTRACT_CALL_GAS_FEE + SWAP_PAYMENT_GAS_FEE + EXPECTED_PAYMENT_WITH_APPROVES_TX_FEE,
791798
coin.utxo.decimals,
792799
);
793-
let sender_refund_fee = big_decimal_from_sat(CONTRACT_CALL_GAS_FEE + EXPECTED_TX_FEE, coin.utxo.decimals);
800+
let sender_refund_fee = big_decimal_from_sat(CONTRACT_CALL_GAS_FEE + EXPECTED_REFUND_TX_FEE, coin.utxo.decimals);
794801

795802
let actual = block_on(coin.get_sender_trade_fee(
796803
TradePreimageValue::Exact(BigDecimal::try_from(2.5).unwrap()),
797-
FeeApproxStage::WithoutApprox,
798-
true,
804+
FeeApproxStage::TradePreimageMax,
799805
))
800806
.expect("!get_sender_trade_fee");
801807
// the expected fee should not include any `approve` contract call
@@ -808,8 +814,7 @@ fn test_sender_trade_preimage_with_allowance() {
808814

809815
let actual = block_on(coin.get_sender_trade_fee(
810816
TradePreimageValue::Exact(BigDecimal::try_from(3.5).unwrap()),
811-
FeeApproxStage::WithoutApprox,
812-
true,
817+
FeeApproxStage::TradePreimageMax,
813818
))
814819
.expect("!get_sender_trade_fee");
815820
// two `approve` contract calls should be included into the expected trade fee
@@ -865,11 +870,10 @@ fn test_get_sender_trade_fee_preimage_for_correct_ticker() {
865870
))
866871
.unwrap();
867872

868-
let actual =
869-
block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(0.into()), FeeApproxStage::OrderIssue, true))
870-
.err()
871-
.unwrap()
872-
.into_inner();
873+
let actual = block_on(coin.get_sender_trade_fee(TradePreimageValue::Exact(0.into()), FeeApproxStage::OrderIssue))
874+
.err()
875+
.unwrap()
876+
.into_inner();
873877
// expecting TradePreimageError::NotSufficientBalance
874878
let expected = TradePreimageError::NotSufficientBalance {
875879
coin: "tQTUM".to_string(),
@@ -889,8 +893,9 @@ fn test_receiver_trade_preimage() {
889893
143, 221, 19, 47, 74, 175, 100,
890894
];
891895
let (_ctx, coin) = qrc20_coin_for_test(priv_key, None);
892-
// check if the coin's tx fee is expected
893-
check_tx_fee(&coin, ActualFeeRate::FixedPerKb(EXPECTED_TX_FEE as u64));
896+
const EXPECTED_TX_FEE: i64 = 544;
897+
// check if the coin's tx fee rate is expected
898+
check_fee_rate(&coin, ActualFeeRate::FixedPerKb(DEFAULT_TX_FEE_RATE as u64));
894899

895900
let actual =
896901
block_on_f01(coin.get_receiver_trade_fee(FeeApproxStage::WithoutApprox)).expect("!get_receiver_trade_fee");
@@ -914,8 +919,9 @@ fn test_taker_fee_tx_fee() {
914919
143, 221, 19, 47, 74, 175, 100,
915920
];
916921
let (_ctx, coin) = qrc20_coin_for_test(priv_key, None);
917-
// check if the coin's tx fee is expected
918-
check_tx_fee(&coin, ActualFeeRate::FixedPerKb(EXPECTED_TX_FEE as u64));
922+
const EXPECTED_TX_FEE: i64 = 447;
923+
// check if the coin's tx fee rate is expected
924+
check_fee_rate(&coin, ActualFeeRate::FixedPerKb(DEFAULT_TX_FEE_RATE as u64));
919925
let expected_balance = CoinBalance {
920926
spendable: BigDecimal::from(5u32),
921927
unspendable: BigDecimal::from(0u32),

mm2src/coins/siacoin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ impl MmCoin for SiaCoin {
284284
&self,
285285
_value: TradePreimageValue,
286286
_stage: FeeApproxStage,
287-
_include_refund_fee: bool,
288287
) -> TradePreimageResult<TradeFee> {
289288
unimplemented!()
290289
}

0 commit comments

Comments
 (0)