From afd9fe75543eda80e6131bce76d5c56b90cef788 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 16 Dec 2022 14:06:08 +0200 Subject: [PATCH 1/3] add missing default priority for btc and ltc --- lib/ionia/ionia_anypay.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ionia/ionia_anypay.dart b/lib/ionia/ionia_anypay.dart index f4053094b..2aaaf4994 100644 --- a/lib/ionia/ionia_anypay.dart +++ b/lib/ionia/ionia_anypay.dart @@ -55,7 +55,9 @@ class IoniaAnyPay { address: out.address, formattedCryptoAmount: out.amount, sendAll: false)).toList(), - feeRate: instruction.requiredFeeRate); + feeRate: instruction.requiredFeeRate, + priority: bitcoin!.getBitcoinTransactionPriorityMedium(), + ); case AnyPayChain.ltc: return bitcoin!.createBitcoinTransactionCredentialsRaw( instruction.outputs.map((out) => @@ -64,7 +66,9 @@ class IoniaAnyPay { address: out.address, formattedCryptoAmount: out.amount, sendAll: false)).toList(), - feeRate: instruction.requiredFeeRate); + feeRate: instruction.requiredFeeRate, + priority: bitcoin!.getLitecoinTransactionPriorityMedium(), + ); default: throw Exception('Incorrect transaction chain: ${payment.chain.toUpperCase()}'); } From 7ffb654065add7d4fe668cfd36a5ed0902152952 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 16 Dec 2022 19:21:40 +0200 Subject: [PATCH 2/3] Calculate fee amount from fee rate if available --- cw_bitcoin/lib/electrum_wallet.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index fad546d90..f31db7bb8 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -191,8 +191,10 @@ abstract class ElectrumWalletBase extends WalletBase Date: Sat, 17 Dec 2022 02:24:15 +0200 Subject: [PATCH 3/3] Remove fallback default priority to calculate fee, in order to know if something is wrong from anypay --- lib/ionia/ionia_anypay.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/ionia/ionia_anypay.dart b/lib/ionia/ionia_anypay.dart index 2aaaf4994..f4053094b 100644 --- a/lib/ionia/ionia_anypay.dart +++ b/lib/ionia/ionia_anypay.dart @@ -55,9 +55,7 @@ class IoniaAnyPay { address: out.address, formattedCryptoAmount: out.amount, sendAll: false)).toList(), - feeRate: instruction.requiredFeeRate, - priority: bitcoin!.getBitcoinTransactionPriorityMedium(), - ); + feeRate: instruction.requiredFeeRate); case AnyPayChain.ltc: return bitcoin!.createBitcoinTransactionCredentialsRaw( instruction.outputs.map((out) => @@ -66,9 +64,7 @@ class IoniaAnyPay { address: out.address, formattedCryptoAmount: out.amount, sendAll: false)).toList(), - feeRate: instruction.requiredFeeRate, - priority: bitcoin!.getLitecoinTransactionPriorityMedium(), - ); + feeRate: instruction.requiredFeeRate); default: throw Exception('Incorrect transaction chain: ${payment.chain.toUpperCase()}'); }