fix: merge clean up

This commit is contained in:
julian 2023-05-24 12:08:32 -06:00
parent 553e035ca7
commit bc868a7d38
18 changed files with 132 additions and 8 deletions

View file

@ -253,8 +253,8 @@ class ECashWallet extends CoinServiceAPI
@override
Future<int> get maxFee async {
final fee = (await fees).fast as String;
final satsFee =
Decimal.parse(fee) * Decimal.fromInt(Constants.satsPerCoin(coin));
final satsFee = Decimal.parse(fee) *
Decimal.fromInt(Constants.satsPerCoin(coin).toInt());
return satsFee.floor().toBigInt().toInt();
}

View file

@ -4824,9 +4824,10 @@ class FiroWallet extends CoinServiceAPI
) async {
var lelantusEntry = await _getLelantusEntry();
final balance = availablePrivateBalance().decimal;
int spendAmount = (balance * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()))
.toBigInt()
.toInt();
int spendAmount =
(balance * Decimal.fromInt(Constants.satsPerCoin(coin).toInt()))
.toBigInt()
.toInt();
if (spendAmount == 0 || lelantusEntry.isEmpty) {
return LelantusFeeData(0, 0, []).fee;
}

View file

@ -37,6 +37,8 @@ final coinIconProvider = Provider.family<String, Coin>((ref, coin) {
return assets.particl;
case Coin.ethereum:
return assets.ethereum;
default:
return assets.bitcoin;
}
} else {
return (assets as ThemeAssetsV2).coinIcons[coin.mainNetVersion]!;

View file

@ -41,6 +41,8 @@ final coinImageProvider = Provider.family<String, Coin>((ref, coin) {
return assets.dogecoinImage;
case Coin.ethereum:
return assets.ethereumImage;
default:
return assets.bitcoinImage;
}
} else {
return (assets as ThemeAssetsV2).coinImages[coin.mainNetVersion]!;
@ -85,6 +87,9 @@ final coinImageSecondaryProvider = Provider.family<String, Coin>((ref, coin) {
return assets.dogecoinImageSecondary;
case Coin.ethereum:
return assets.ethereumImageSecondary;
default:
return assets.ethereumImageSecondary;
}
} else {
return (assets as ThemeAssetsV2).coinSecondaryImages[coin.mainNetVersion]!;

View file

@ -25,11 +25,12 @@ abstract class Constants {
// static bool enableBuy = enableExchange;
// // 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 _satsPerCoinMonero = BigInt.from(1000000000000);
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 const int _decimalPlaces = 8;
static const int _decimalPlacesNano = 6;

View file

@ -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/namecoin/namecoin_wallet.dart'
as nmc;
import 'package:stackwallet/services/coins/nano/nano_wallet.dart' as nano;
import 'package:stackwallet/services/coins/particl/particl_wallet.dart'
as particl;
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';
enum Coin {

View file

@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -2278,6 +2278,15 @@ class MockThemeService extends _i1.Mock implements _i32.ThemeService {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -1086,6 +1086,14 @@ class MockFiroWallet extends _i1.Mock implements _i10.FiroWallet {
returnValueForMissingStub: _i11.Future<void>.value(),
) as _i11.Future<void>);
@override
int firoGetMintIndex() => (super.noSuchMethod(
Invocation.method(
#firoGetMintIndex,
[],
),
returnValue: 0,
) as int);
@override
_i11.Future<void> firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod(
Invocation.method(
#firoUpdateMintIndex,

View file

@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -2008,6 +2008,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -729,6 +729,15 @@ class MockThemeService extends _i1.Mock implements _i25.ThemeService {
returnValueForMissingStub: _i22.Future<void>.value(),
) as _i22.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -2076,6 +2076,14 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet {
returnValueForMissingStub: _i18.Future<void>.value(),
) as _i18.Future<void>);
@override
int firoGetMintIndex() => (super.noSuchMethod(
Invocation.method(
#firoGetMintIndex,
[],
),
returnValue: 0,
) as int);
@override
_i18.Future<void> firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod(
Invocation.method(
#firoUpdateMintIndex,
@ -2864,6 +2872,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService {
returnValueForMissingStub: _i18.Future<void>.value(),
) as _i18.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -1812,6 +1812,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService {
returnValueForMissingStub: _i21.Future<void>.value(),
) as _i21.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(

View file

@ -741,6 +741,15 @@ class MockThemeService extends _i1.Mock implements _i26.ThemeService {
returnValueForMissingStub: _i23.Future<void>.value(),
) as _i23.Future<void>);
@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}) =>
(super.noSuchMethod(
Invocation.method(