fix stellarTestNet and dependency problems

This commit is contained in:
detherminal 2023-07-28 23:00:14 +03:00
parent f4688bd041
commit a1ef84fbe6
16 changed files with 49 additions and 35 deletions

View file

@ -197,7 +197,7 @@ class _AddEditNodeViewState extends ConsumerState<AddEditNodeView> {
case Coin.nano: case Coin.nano:
case Coin.banano: case Coin.banano:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
throw UnimplementedError(); throw UnimplementedError();
//TODO: check network/node //TODO: check network/node
case Coin.tezos: case Coin.tezos:
@ -732,11 +732,14 @@ class _NodeFormState extends ConsumerState<NodeForm> {
case Coin.namecoin: case Coin.namecoin:
case Coin.bitcoincash: case Coin.bitcoincash:
case Coin.particl: case Coin.particl:
case Coin.stellar:
case Coin.tezos:
case Coin.bitcoinTestNet: case Coin.bitcoinTestNet:
case Coin.litecoinTestNet: case Coin.litecoinTestNet:
case Coin.bitcoincashTestnet: case Coin.bitcoincashTestnet:
case Coin.firoTestNet: case Coin.firoTestNet:
case Coin.dogecoinTestNet: case Coin.dogecoinTestNet:
case Coin.stellarTestNet:
case Coin.epicCash: case Coin.epicCash:
case Coin.nano: case Coin.nano:
case Coin.banano: case Coin.banano:

View file

@ -174,7 +174,7 @@ class _NodeDetailsViewState extends ConsumerState<NodeDetailsView> {
case Coin.banano: case Coin.banano:
case Coin.tezos: case Coin.tezos:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
throw UnimplementedError(); throw UnimplementedError();
//TODO: check network/node //TODO: check network/node
} }

View file

@ -229,6 +229,15 @@ abstract class CoinServiceAPI {
tracker: tracker, tracker: tracker,
); );
case Coin.stellarTestNet:
return StellarWallet(
walletId: walletId,
walletName: walletName,
coin: coin,
secureStore: secureStorageInterface,
tracker: tracker,
);
case Coin.tezos: case Coin.tezos:
return TezosWallet( return TezosWallet(
walletId: walletId, walletId: walletId,

View file

@ -65,7 +65,7 @@ class CoinThemeColorDefault {
case Coin.particl: case Coin.particl:
return particl; return particl;
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return stellar; return stellar;
case Coin.nano: case Coin.nano:
return nano; return nano;

View file

@ -1708,7 +1708,7 @@ class StackColors extends ThemeExtension<StackColors> {
case Coin.particl: case Coin.particl:
return _coin.particl; return _coin.particl;
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return _coin.stellar; return _coin.stellar;
case Coin.nano: case Coin.nano:
return _coin.nano; return _coin.nano;

View file

@ -143,7 +143,7 @@ class AddressUtils {
return Address.validateAddress(address, firoTestNetwork); return Address.validateAddress(address, firoTestNetwork);
case Coin.dogecoinTestNet: case Coin.dogecoinTestNet:
return Address.validateAddress(address, dogecointestnet); return Address.validateAddress(address, dogecointestnet);
case Coin.stellarTestnet: case Coin.stellarTestNet:
return RegExp(r"^[G][A-Z0-9]{55}$").hasMatch(address); return RegExp(r"^[G][A-Z0-9]{55}$").hasMatch(address);
} }
} }

View file

@ -51,7 +51,7 @@ enum AmountUnit {
case Coin.eCash: case Coin.eCash:
case Coin.epicCash: case Coin.epicCash:
case Coin.stellar: // TODO: check if this is correct case Coin.stellar: // TODO: check if this is correct
case Coin.stellarTestnet: case Coin.stellarTestNet:
case Coin.tezos: case Coin.tezos:
return AmountUnit.values.sublist(0, 4); return AmountUnit.values.sublist(0, 4);

View file

@ -60,7 +60,7 @@ Uri getDefaultBlockExplorerUrlFor({
return Uri.parse("https://www.nanolooker.com/block/$txid"); return Uri.parse("https://www.nanolooker.com/block/$txid");
case Coin.banano: case Coin.banano:
return Uri.parse("https://www.bananolooker.com/block/$txid"); return Uri.parse("https://www.bananolooker.com/block/$txid");
case Coin.stellarTestnet: case Coin.stellarTestNet:
return Uri.parse("https://testnet.stellarchain.io/transactions/$txid"); return Uri.parse("https://testnet.stellarchain.io/transactions/$txid");
case Coin.tezos: case Coin.tezos:
return Uri.parse("https://tzstats.com/$txid"); return Uri.parse("https://tzstats.com/$txid");

View file

@ -102,7 +102,7 @@ abstract class Constants {
return _satsPerCoinECash; return _satsPerCoinECash;
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return _satsPerCoinStellar; return _satsPerCoinStellar;
case Coin.tezos: case Coin.tezos:
@ -146,7 +146,7 @@ abstract class Constants {
return _decimalPlacesECash; return _decimalPlacesECash;
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return _decimalPlacesStellar; return _decimalPlacesStellar;
case Coin.tezos: case Coin.tezos:
@ -174,7 +174,7 @@ abstract class Constants {
case Coin.particl: case Coin.particl:
case Coin.nano: case Coin.nano:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
values.addAll([24, 12]); values.addAll([24, 12]);
break; break;
case Coin.banano: case Coin.banano:
@ -238,7 +238,7 @@ abstract class Constants {
return 1; return 1;
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return 5; return 5;
case Coin.tezos: case Coin.tezos:
@ -271,7 +271,7 @@ abstract class Constants {
case Coin.nano: case Coin.nano:
case Coin.banano: case Coin.banano:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
case Coin.tezos: case Coin.tezos:
return 24; return 24;

View file

@ -292,10 +292,10 @@ abstract class DefaultNodes {
host: "https://horizon-testnet.stellar.org/", host: "https://horizon-testnet.stellar.org/",
port: 50022, port: 50022,
name: defaultName, name: defaultName,
id: _nodeId(Coin.stellarTestnet), id: _nodeId(Coin.stellarTestNet),
useSSL: true, useSSL: true,
enabled: true, enabled: true,
coinName: Coin.stellarTestnet.name, coinName: Coin.stellarTestNet.name,
isFailover: true, isFailover: true,
isDown: false, isDown: false,
); );
@ -365,7 +365,7 @@ abstract class DefaultNodes {
case Coin.dogecoinTestNet: case Coin.dogecoinTestNet:
return dogecoinTestnet; return dogecoinTestnet;
case Coin.stellarTestnet: case Coin.stellarTestNet:
return stellarTestnet; return stellarTestnet;
} }
} }

View file

@ -60,9 +60,10 @@ enum Coin {
dogecoinTestNet, dogecoinTestNet,
firoTestNet, firoTestNet,
litecoinTestNet, litecoinTestNet,
stellarTestNet,
} }
final int kTestNetCoinCount = 4; // Util.isDesktop ? 5 : 4; final int kTestNetCoinCount = 5; // Util.isDesktop ? 5 : 4;
// remove firotestnet for now // remove firotestnet for now
extension CoinExt on Coin { extension CoinExt on Coin {
@ -110,6 +111,8 @@ extension CoinExt on Coin {
return "tFiro"; return "tFiro";
case Coin.dogecoinTestNet: case Coin.dogecoinTestNet:
return "tDogecoin"; return "tDogecoin";
case Coin.stellarTestNet:
return "tStellar";
} }
} }
@ -157,7 +160,7 @@ extension CoinExt on Coin {
return "tFIRO"; return "tFIRO";
case Coin.dogecoinTestNet: case Coin.dogecoinTestNet:
return "tDOGE"; return "tDOGE";
case Coin.stellarTestnet: case Coin.stellarTestNet:
return "tXLM"; return "tXLM";
} }
} }
@ -207,7 +210,7 @@ extension CoinExt on Coin {
return "firo"; return "firo";
case Coin.dogecoinTestNet: case Coin.dogecoinTestNet:
return "dogecoin"; return "dogecoin";
case Coin.stellarTestnet: case Coin.stellarTestNet:
return "stellar"; return "stellar";
} }
} }
@ -237,7 +240,7 @@ extension CoinExt on Coin {
case Coin.nano: case Coin.nano:
case Coin.banano: case Coin.banano:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return false; return false;
} }
} }
@ -267,7 +270,7 @@ extension CoinExt on Coin {
case Coin.nano: case Coin.nano:
case Coin.banano: case Coin.banano:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return false; return false;
} }
} }
@ -297,7 +300,7 @@ extension CoinExt on Coin {
case Coin.litecoinTestNet: case Coin.litecoinTestNet:
case Coin.bitcoincashTestnet: case Coin.bitcoincashTestnet:
case Coin.firoTestNet: case Coin.firoTestNet:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return true; return true;
} }
} }
@ -337,7 +340,7 @@ extension CoinExt on Coin {
case Coin.firoTestNet: case Coin.firoTestNet:
return Coin.firo; return Coin.firo;
case Coin.stellarTestnet: case Coin.stellarTestNet:
return Coin.stellar; return Coin.stellar;
} }
} }
@ -380,7 +383,7 @@ extension CoinExt on Coin {
return particl.MINIMUM_CONFIRMATIONS; return particl.MINIMUM_CONFIRMATIONS;
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
return xlm.MINIMUM_CONFIRMATIONS; return xlm.MINIMUM_CONFIRMATIONS;
case Coin.tezos: case Coin.tezos:
@ -500,7 +503,7 @@ Coin coinFromPrettyName(String name) {
case "Stellar Testnet": case "Stellar Testnet":
case "stellarTestnet": case "stellarTestnet":
case "tStellar": case "tStellar":
return Coin.stellarTestnet; return Coin.stellarTestNet;
default: default:
throw ArgumentError.value( throw ArgumentError.value(
@ -556,7 +559,7 @@ Coin coinFromTickerCaseInsensitive(String ticker) {
case "ban": case "ban":
return Coin.banano; return Coin.banano;
case "txlm": case "txlm":
return Coin.stellarTestnet; return Coin.stellarTestNet;
default: default:
throw ArgumentError.value( throw ArgumentError.value(
ticker, "name", "No Coin enum value with that ticker"); ticker, "name", "No Coin enum value with that ticker");

View file

@ -50,7 +50,7 @@ extension DerivePathTypeExt on DerivePathType {
case Coin.nano: case Coin.nano:
case Coin.banano: case Coin.banano:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
case Coin.tezos: // TODO: Is this true? case Coin.tezos: // TODO: Is this true?
throw UnsupportedError( throw UnsupportedError(
"$coin does not use bitcoin style derivation paths"); "$coin does not use bitcoin style derivation paths");

View file

@ -196,7 +196,7 @@ class _NodeCardState extends ConsumerState<NodeCard> {
case Coin.banano: case Coin.banano:
case Coin.tezos: case Coin.tezos:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
throw UnimplementedError(); throw UnimplementedError();
//TODO: check network/node //TODO: check network/node
} }

View file

@ -179,7 +179,7 @@ class NodeOptionsSheet extends ConsumerWidget {
case Coin.banano: case Coin.banano:
case Coin.tezos: case Coin.tezos:
case Coin.stellar: case Coin.stellar:
case Coin.stellarTestnet: case Coin.stellarTestNet:
throw UnimplementedError(); throw UnimplementedError();
//TODO: check network/node //TODO: check network/node
} }

View file

@ -459,7 +459,7 @@ packages:
source: hosted source: hosted
version: "0.6.0" version: "0.6.0"
dio: dio:
dependency: "direct overridden" dependency: transitive
description: description:
name: dio name: dio
sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8" sha256: "7d328c4d898a61efc3cd93655a0955858e29a0aa647f0f9e02d59b3bb275e2e8"
@ -1297,10 +1297,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: pretty_dio_logger name: pretty_dio_logger
sha256: "00b80053063935cf9a6190da344c5373b9d0e92da4c944c878ff2fbef0ef6dc2" sha256: "948f7eeb36e7aa0760b51c1a8e3331d4b21e36fabd39efca81f585ed93893544"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.1" version: "1.2.0-beta-1"
process: process:
dependency: transitive dependency: transitive
description: description:
@ -1519,10 +1519,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: stellar_flutter_sdk name: stellar_flutter_sdk
sha256: "7a9b7dc76018bbd0b9c828045cf0e26e07ec44208fb1a1733273de2390205475" sha256: "4c55b1b6dfbde7f89bba59a422754280715fa3b5726cff5e7eeaed454d2c4b89"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.6.0" version: "1.5.3"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:

View file

@ -138,7 +138,7 @@ dependencies:
desktop_drop: ^0.4.1 desktop_drop: ^0.4.1
nanodart: ^2.0.0 nanodart: ^2.0.0
basic_utils: ^5.5.4 basic_utils: ^5.5.4
stellar_flutter_sdk: ^1.6.0 stellar_flutter_sdk: ^1.5.3
tezart: ^2.0.5 tezart: ^2.0.5
dev_dependencies: dev_dependencies:
@ -203,7 +203,6 @@ dependency_overrides:
crypto: 3.0.2 crypto: 3.0.2
analyzer: ^5.2.0 analyzer: ^5.2.0
pinenacl: ^0.3.3 pinenacl: ^0.3.3
dio : ^4.0.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec