mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
CW-531-Bitcoin-Fees-issue (#1218)
* SegWit transaction size * [skip ci] fix electrum balances layout * fix tapping area
This commit is contained in:
parent
ef7762eaca
commit
faf151a4dc
4 changed files with 15 additions and 7 deletions
|
@ -4,7 +4,10 @@ import 'package:cw_bitcoin/bitcoin_amount_format.dart';
|
|||
import 'package:cw_core/balance.dart';
|
||||
|
||||
class ElectrumBalance extends Balance {
|
||||
const ElectrumBalance({required this.confirmed, required this.unconfirmed, required this.frozen})
|
||||
const ElectrumBalance(
|
||||
{required this.confirmed,
|
||||
required this.unconfirmed,
|
||||
required this.frozen})
|
||||
: super(confirmed, unconfirmed);
|
||||
|
||||
static ElectrumBalance? fromJSON(String? jsonSource) {
|
||||
|
@ -25,16 +28,19 @@ class ElectrumBalance extends Balance {
|
|||
final int frozen;
|
||||
|
||||
@override
|
||||
String get formattedAvailableBalance => bitcoinAmountToString(amount: confirmed - frozen);
|
||||
String get formattedAvailableBalance =>
|
||||
bitcoinAmountToString(amount: confirmed - unconfirmed.abs() - frozen);
|
||||
|
||||
@override
|
||||
String get formattedAdditionalBalance => bitcoinAmountToString(amount: unconfirmed);
|
||||
String get formattedAdditionalBalance =>
|
||||
bitcoinAmountToString(amount: unconfirmed);
|
||||
|
||||
String get formattedFrozenBalance {
|
||||
@override
|
||||
String get formattedUnAvailableBalance {
|
||||
final frozenFormatted = bitcoinAmountToString(amount: frozen);
|
||||
return frozenFormatted == '0.0' ? '' : frozenFormatted;
|
||||
}
|
||||
|
||||
String toJSON() =>
|
||||
json.encode({'confirmed': confirmed, 'unconfirmed': unconfirmed, 'frozen': frozen});
|
||||
String toJSON() => json.encode(
|
||||
{'confirmed': confirmed, 'unconfirmed': unconfirmed, 'frozen': frozen});
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ abstract class ElectrumWalletBase
|
|||
bitcoin.HDWallet.fromSeed(seedBytes).derivePath("m/44'/145'/0'/0");
|
||||
|
||||
static int estimatedTransactionSize(int inputsCount, int outputsCounts) =>
|
||||
inputsCount * 146 + outputsCounts * 33 + 8;
|
||||
inputsCount * 68 + outputsCounts * 34 + 10;
|
||||
|
||||
final bitcoin.HDWallet hd;
|
||||
final String mnemonic;
|
||||
|
|
|
@ -135,6 +135,7 @@ class ContactListPage extends BasePage {
|
|||
await showBar<void>(context, S.of(context).copied_to_clipboard);
|
||||
}
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 24),
|
||||
child: Row(
|
||||
|
|
|
@ -18,6 +18,7 @@ class HomeScreenAccountWidget extends StatelessWidget {
|
|||
context: context,
|
||||
builder: (_) => getIt.get<MoneroAccountListPage>());
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
height: 100.0,
|
||||
child: Row(
|
||||
|
|
Loading…
Reference in a new issue