mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-11 05:04:35 +00:00
fix: merge clean up
This commit is contained in:
parent
553e035ca7
commit
bc868a7d38
18 changed files with 132 additions and 8 deletions
|
@ -253,8 +253,8 @@ class ECashWallet extends CoinServiceAPI
|
||||||
@override
|
@override
|
||||||
Future<int> get maxFee async {
|
Future<int> get maxFee async {
|
||||||
final fee = (await fees).fast as String;
|
final fee = (await fees).fast as String;
|
||||||
final satsFee =
|
final satsFee = Decimal.parse(fee) *
|
||||||
Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin));
|
Decimal.fromInt(Constants.satsPerCoin(coin).toInt());
|
||||||
return satsFee.floor().toBigInt().toInt();
|
return satsFee.floor().toBigInt().toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4824,7 +4824,8 @@ class FiroWallet extends CoinServiceAPI
|
||||||
) async {
|
) async {
|
||||||
var lelantusEntry = await _getLelantusEntry();
|
var lelantusEntry = await _getLelantusEntry();
|
||||||
final balance = availablePrivateBalance().decimal;
|
final balance = availablePrivateBalance().decimal;
|
||||||
int spendAmount = (balance * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()))
|
int spendAmount =
|
||||||
|
(balance * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()))
|
||||||
.toBigInt()
|
.toBigInt()
|
||||||
.toInt();
|
.toInt();
|
||||||
if (spendAmount == 0 || lelantusEntry.isEmpty) {
|
if (spendAmount == 0 || lelantusEntry.isEmpty) {
|
||||||
|
|
|
@ -37,6 +37,8 @@ final coinIconProvider = Provider.family<String, Coin>((ref, coin) {
|
||||||
return assets.particl;
|
return assets.particl;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return assets.ethereum;
|
return assets.ethereum;
|
||||||
|
default:
|
||||||
|
return assets.bitcoin;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return (assets as ThemeAssetsV2).coinIcons[coin.mainNetVersion]!;
|
return (assets as ThemeAssetsV2).coinIcons[coin.mainNetVersion]!;
|
||||||
|
|
|
@ -41,6 +41,8 @@ final coinImageProvider = Provider.family<String, Coin>((ref, coin) {
|
||||||
return assets.dogecoinImage;
|
return assets.dogecoinImage;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return assets.ethereumImage;
|
return assets.ethereumImage;
|
||||||
|
default:
|
||||||
|
return assets.bitcoinImage;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return (assets as ThemeAssetsV2).coinImages[coin.mainNetVersion]!;
|
return (assets as ThemeAssetsV2).coinImages[coin.mainNetVersion]!;
|
||||||
|
@ -85,6 +87,9 @@ final coinImageSecondaryProvider = Provider.family<String, Coin>((ref, coin) {
|
||||||
return assets.dogecoinImageSecondary;
|
return assets.dogecoinImageSecondary;
|
||||||
case Coin.ethereum:
|
case Coin.ethereum:
|
||||||
return assets.ethereumImageSecondary;
|
return assets.ethereumImageSecondary;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return assets.ethereumImageSecondary;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return (assets as ThemeAssetsV2).coinSecondaryImages[coin.mainNetVersion]!;
|
return (assets as ThemeAssetsV2).coinSecondaryImages[coin.mainNetVersion]!;
|
||||||
|
|
|
@ -25,11 +25,12 @@ abstract class Constants {
|
||||||
// static bool enableBuy = enableExchange;
|
// static bool enableBuy = enableExchange;
|
||||||
// // true; // true for development,
|
// // true; // true for development,
|
||||||
|
|
||||||
static const BigInt _satsPerCoinECash = BigInt.from(100);
|
static final BigInt _satsPerCoinECash = BigInt.from(100);
|
||||||
static final BigInt _satsPerCoinEthereum = BigInt.from(1000000000000000000);
|
static final BigInt _satsPerCoinEthereum = BigInt.from(1000000000000000000);
|
||||||
static final BigInt _satsPerCoinMonero = BigInt.from(1000000000000);
|
static final BigInt _satsPerCoinMonero = BigInt.from(1000000000000);
|
||||||
static final BigInt _satsPerCoinWownero = BigInt.from(100000000000);
|
static final BigInt _satsPerCoinWownero = BigInt.from(100000000000);
|
||||||
static final BigInt _satsPerCoinNano = BigInt.parse("1000000000000000000000000000000");
|
static final BigInt _satsPerCoinNano =
|
||||||
|
BigInt.parse("1000000000000000000000000000000");
|
||||||
static final BigInt _satsPerCoin = BigInt.from(100000000);
|
static final BigInt _satsPerCoin = BigInt.from(100000000);
|
||||||
static const int _decimalPlaces = 8;
|
static const int _decimalPlaces = 8;
|
||||||
static const int _decimalPlacesNano = 6;
|
static const int _decimalPlacesNano = 6;
|
||||||
|
|
|
@ -14,10 +14,10 @@ import 'package:stackwallet/services/coins/litecoin/litecoin_wallet.dart'
|
||||||
import 'package:stackwallet/services/coins/monero/monero_wallet.dart' as xmr;
|
import 'package:stackwallet/services/coins/monero/monero_wallet.dart' as xmr;
|
||||||
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart'
|
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart'
|
||||||
as nmc;
|
as nmc;
|
||||||
|
import 'package:stackwallet/services/coins/nano/nano_wallet.dart' as nano;
|
||||||
import 'package:stackwallet/services/coins/particl/particl_wallet.dart'
|
import 'package:stackwallet/services/coins/particl/particl_wallet.dart'
|
||||||
as particl;
|
as particl;
|
||||||
import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart' as wow;
|
import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart' as wow;
|
||||||
import 'package:stackwallet/services/coins/nano/nano_wallet.dart' as nano;
|
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
|
||||||
enum Coin {
|
enum Coin {
|
||||||
|
|
|
@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
) as _i5.Future<void>);
|
) as _i5.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
|
) as _i5.Future<void>);
|
||||||
|
@override
|
||||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -2278,6 +2278,15 @@ class MockThemeService extends _i1.Mock implements _i32.ThemeService {
|
||||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||||
) as _i23.Future<void>);
|
) as _i23.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i23.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i23.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||||
|
) as _i23.Future<void>);
|
||||||
|
@override
|
||||||
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -1086,6 +1086,14 @@ class MockFiroWallet extends _i1.Mock implements _i10.FiroWallet {
|
||||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||||
) as _i11.Future<void>);
|
) as _i11.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
int firoGetMintIndex() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#firoGetMintIndex,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: 0,
|
||||||
|
) as int);
|
||||||
|
@override
|
||||||
_i11.Future<void> firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod(
|
_i11.Future<void> firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#firoUpdateMintIndex,
|
#firoUpdateMintIndex,
|
||||||
|
|
|
@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
) as _i5.Future<void>);
|
) as _i5.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
|
) as _i5.Future<void>);
|
||||||
|
@override
|
||||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
) as _i5.Future<void>);
|
) as _i5.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
|
) as _i5.Future<void>);
|
||||||
|
@override
|
||||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
) as _i5.Future<void>);
|
) as _i5.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
|
) as _i5.Future<void>);
|
||||||
|
@override
|
||||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -2008,6 +2008,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService {
|
||||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||||
) as _i23.Future<void>);
|
) as _i23.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i23.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i23.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||||
|
) as _i23.Future<void>);
|
||||||
|
@override
|
||||||
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -729,6 +729,15 @@ class MockThemeService extends _i1.Mock implements _i25.ThemeService {
|
||||||
returnValueForMissingStub: _i22.Future<void>.value(),
|
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||||
) as _i22.Future<void>);
|
) as _i22.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i22.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i22.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i22.Future<void>.value(),
|
||||||
|
) as _i22.Future<void>);
|
||||||
|
@override
|
||||||
_i22.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i22.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
) as _i5.Future<void>);
|
) as _i5.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||||
|
) as _i5.Future<void>);
|
||||||
|
@override
|
||||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -2076,6 +2076,14 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet {
|
||||||
returnValueForMissingStub: _i18.Future<void>.value(),
|
returnValueForMissingStub: _i18.Future<void>.value(),
|
||||||
) as _i18.Future<void>);
|
) as _i18.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
int firoGetMintIndex() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#firoGetMintIndex,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: 0,
|
||||||
|
) as int);
|
||||||
|
@override
|
||||||
_i18.Future<void> firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod(
|
_i18.Future<void> firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#firoUpdateMintIndex,
|
#firoUpdateMintIndex,
|
||||||
|
@ -2864,6 +2872,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService {
|
||||||
returnValueForMissingStub: _i18.Future<void>.value(),
|
returnValueForMissingStub: _i18.Future<void>.value(),
|
||||||
) as _i18.Future<void>);
|
) as _i18.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i18.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i18.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i18.Future<void>.value(),
|
||||||
|
) as _i18.Future<void>);
|
||||||
|
@override
|
||||||
_i18.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i18.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -1812,6 +1812,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService {
|
||||||
returnValueForMissingStub: _i21.Future<void>.value(),
|
returnValueForMissingStub: _i21.Future<void>.value(),
|
||||||
) as _i21.Future<void>);
|
) as _i21.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i21.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i21.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i21.Future<void>.value(),
|
||||||
|
) as _i21.Future<void>);
|
||||||
|
@override
|
||||||
_i21.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i21.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
|
@ -741,6 +741,15 @@ class MockThemeService extends _i1.Mock implements _i26.ThemeService {
|
||||||
returnValueForMissingStub: _i23.Future<void>.value(),
|
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||||
) as _i23.Future<void>);
|
) as _i23.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i23.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#checkDefaultThemesOnStartup,
|
||||||
|
[],
|
||||||
|
),
|
||||||
|
returnValue: _i23.Future<void>.value(),
|
||||||
|
returnValueForMissingStub: _i23.Future<void>.value(),
|
||||||
|
) as _i23.Future<void>);
|
||||||
|
@override
|
||||||
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
_i23.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
|
Loading…
Reference in a new issue