From 30b77ebd584af402552ccb05c803f276236019b9 Mon Sep 17 00:00:00 2001 From: M Date: Fri, 14 Jan 2022 14:19:25 +0200 Subject: [PATCH] Linter errors fixes. Move secrandom native to cw_core --- cw_bitcoin/lib/bitcoin_amount_format.dart | 2 - cw_bitcoin/lib/bitcoin_mnemonic.dart | 2 +- .../lib/bitcoin_transaction_priority.dart | 14 +++--- cw_bitcoin/lib/electrum.dart | 1 + cw_bitcoin/lib/electrum_wallet.dart | 1 - cw_bitcoin/lib/litecoin_wallet_addresses.dart | 1 - cw_bitcoin/pubspec.lock | 43 +++++++++++++++++-- cw_bitcoin/pubspec.yaml | 8 +++- .../lib}/sec_random_native.dart | 0 cw_core/lib/transaction_info.dart | 2 +- cw_core/pubspec.lock | 33 +++++++++++--- cw_core/pubspec.yaml | 6 ++- cw_monero/pubspec.yaml | 5 ++- 13 files changed, 89 insertions(+), 29 deletions(-) rename {lib/core => cw_core/lib}/sec_random_native.dart (100%) diff --git a/cw_bitcoin/lib/bitcoin_amount_format.dart b/cw_bitcoin/lib/bitcoin_amount_format.dart index 03269d5ab..0c846596f 100644 --- a/cw_bitcoin/lib/bitcoin_amount_format.dart +++ b/cw_bitcoin/lib/bitcoin_amount_format.dart @@ -1,5 +1,3 @@ -import 'dart:math'; - import 'package:intl/intl.dart'; import 'package:cw_core/crypto_amount_format.dart'; diff --git a/cw_bitcoin/lib/bitcoin_mnemonic.dart b/cw_bitcoin/lib/bitcoin_mnemonic.dart index 4f56161e0..65f4ae0df 100644 --- a/cw_bitcoin/lib/bitcoin_mnemonic.dart +++ b/cw_bitcoin/lib/bitcoin_mnemonic.dart @@ -4,7 +4,7 @@ import 'dart:typed_data'; import 'package:crypto/crypto.dart'; import 'package:unorm_dart/unorm_dart.dart' as unorm; import 'package:cryptography/cryptography.dart' as cryptography; -import 'package:cake_wallet/core/sec_random_native.dart'; +import 'package:cw_core/sec_random_native.dart'; const segwit = '100'; final wordlist = englishWordlist; diff --git a/cw_bitcoin/lib/bitcoin_transaction_priority.dart b/cw_bitcoin/lib/bitcoin_transaction_priority.dart index 295102d85..f006e25e4 100644 --- a/cw_bitcoin/lib/bitcoin_transaction_priority.dart +++ b/cw_bitcoin/lib/bitcoin_transaction_priority.dart @@ -1,5 +1,5 @@ import 'package:cw_core/transaction_priority.dart'; -import 'package:cake_wallet/generated/i18n.dart'; +//import 'package:cake_wallet/generated/i18n.dart'; class BitcoinTransactionPriority extends TransactionPriority { const BitcoinTransactionPriority({String title, int raw}) @@ -34,13 +34,13 @@ class BitcoinTransactionPriority extends TransactionPriority { switch (this) { case BitcoinTransactionPriority.slow: - label = '${S.current.transaction_priority_slow} ~24hrs'; + label = 'Slow ~24hrs'; // '${S.current.transaction_priority_slow} ~24hrs'; break; case BitcoinTransactionPriority.medium: - label = S.current.transaction_priority_medium; + label = 'Medium'; // S.current.transaction_priority_medium; break; case BitcoinTransactionPriority.fast: - label = S.current.transaction_priority_fast; + label = 'Fast'; // S.current.transaction_priority_fast; break; default: break; @@ -86,13 +86,13 @@ class LitecoinTransactionPriority extends BitcoinTransactionPriority { switch (this) { case LitecoinTransactionPriority.slow: - label = S.current.transaction_priority_slow; + label = 'Slow'; // S.current.transaction_priority_slow; break; case LitecoinTransactionPriority.medium: - label = S.current.transaction_priority_medium; + label = 'Medium'; // S.current.transaction_priority_medium; break; case LitecoinTransactionPriority.fast: - label = S.current.transaction_priority_fast; + label = 'Fast'; // S.current.transaction_priority_fast; break; default: break; diff --git a/cw_bitcoin/lib/electrum.dart b/cw_bitcoin/lib/electrum.dart index 47cf7e5ce..fd6211b8a 100644 --- a/cw_bitcoin/lib/electrum.dart +++ b/cw_bitcoin/lib/electrum.dart @@ -326,6 +326,7 @@ class ElectrumClient { return subscription; } catch(e) { print(e.toString()); + return null; } } diff --git a/cw_bitcoin/lib/electrum_wallet.dart b/cw_bitcoin/lib/electrum_wallet.dart index 6d413643d..37ef36ba2 100644 --- a/cw_bitcoin/lib/electrum_wallet.dart +++ b/cw_bitcoin/lib/electrum_wallet.dart @@ -12,7 +12,6 @@ import 'package:cw_bitcoin/electrum_transaction_info.dart'; import 'package:cw_core/pathForWallet.dart'; import 'package:cw_bitcoin/address_to_output_script.dart'; import 'package:cw_bitcoin/bitcoin_address_record.dart'; -import 'package:cw_bitcoin/bitcoin_amount_format.dart'; import 'package:cw_bitcoin/electrum_balance.dart'; import 'package:cw_bitcoin/bitcoin_mnemonic.dart'; import 'package:cw_bitcoin/bitcoin_transaction_credentials.dart'; diff --git a/cw_bitcoin/lib/litecoin_wallet_addresses.dart b/cw_bitcoin/lib/litecoin_wallet_addresses.dart index ab2e332b9..e6658f10d 100644 --- a/cw_bitcoin/lib/litecoin_wallet_addresses.dart +++ b/cw_bitcoin/lib/litecoin_wallet_addresses.dart @@ -1,5 +1,4 @@ import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin; -import 'package:cw_bitcoin/bitcoin_mnemonic.dart'; import 'package:cw_bitcoin/utils.dart'; import 'package:cw_bitcoin/bitcoin_address_record.dart'; import 'package:cw_bitcoin/electrum_wallet_addresses.dart'; diff --git a/cw_bitcoin/pubspec.lock b/cw_bitcoin/pubspec.lock index 99e49a97b..504c92fab 100644 --- a/cw_bitcoin/pubspec.lock +++ b/cw_bitcoin/pubspec.lock @@ -21,7 +21,14 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "1.6.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.5" async: dependency: transitive description: @@ -123,14 +130,14 @@ packages: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.1.1" + version: "4.3.2" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.3" + version: "7.1.0" characters: dependency: transitive description: @@ -194,6 +201,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.5" + cryptography: + dependency: "direct main" + description: + name: cryptography + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.1" cw_core: dependency: "direct main" description: @@ -215,6 +229,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.5.0" + encrypt: + dependency: "direct main" + description: + name: encrypt + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.3" fake_async: dependency: transitive description: @@ -242,7 +263,7 @@ packages: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "0.10.11" flutter: dependency: "direct main" description: flutter @@ -491,6 +512,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.8" + quiver: + dependency: transitive + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.5" rxdart: dependency: "direct main" description: @@ -594,6 +622,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + unorm_dart: + dependency: "direct main" + description: + name: unorm_dart + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" vector_math: dependency: transitive description: diff --git a/cw_bitcoin/pubspec.yaml b/cw_bitcoin/pubspec.yaml index 694922528..d7c324775 100644 --- a/cw_bitcoin/pubspec.yaml +++ b/cw_bitcoin/pubspec.yaml @@ -1,8 +1,9 @@ name: cw_bitcoin description: A new Flutter package project. version: 0.0.1 -author: -homepage: +publish_to: none +author: Cake Wallet +homepage: https://cakewallet.com environment: sdk: ">=2.7.0 <3.0.0" @@ -23,6 +24,9 @@ dependencies: url: https://github.com/cake-tech/bitcoin_flutter.git ref: cake rxdart: ^0.26.0 + unorm_dart: ^0.2.0 + cryptography: ^1.4.0 + encrypt: ^4.0.0 dev_dependencies: flutter_test: diff --git a/lib/core/sec_random_native.dart b/cw_core/lib/sec_random_native.dart similarity index 100% rename from lib/core/sec_random_native.dart rename to cw_core/lib/sec_random_native.dart diff --git a/cw_core/lib/transaction_info.dart b/cw_core/lib/transaction_info.dart index b5779c817..9d72fa843 100644 --- a/cw_core/lib/transaction_info.dart +++ b/cw_core/lib/transaction_info.dart @@ -1,5 +1,5 @@ import 'package:cw_core/transaction_direction.dart'; -import 'package:cake_wallet/utils/mobx.dart'; +//import 'package:cake_wallet/utils/mobx.dart'; import 'package:cw_core/keyable.dart'; abstract class TransactionInfo extends Object with Keyable { diff --git a/cw_core/pubspec.lock b/cw_core/pubspec.lock index 7a4fdf385..9858511de 100644 --- a/cw_core/pubspec.lock +++ b/cw_core/pubspec.lock @@ -21,7 +21,14 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "1.6.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.1" async: dependency: transitive description: @@ -147,14 +154,14 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "2.1.5" dart_style: dependency: transitive description: @@ -168,7 +175,14 @@ packages: name: dartx url: "https://pub.dartlang.org" source: hosted - version: "0.8.0" + version: "0.5.0" + encrypt: + dependency: "direct main" + description: + name: encrypt + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" fake_async: dependency: transitive description: @@ -234,7 +248,7 @@ packages: name: hive url: "https://pub.dartlang.org" source: hosted - version: "1.6.0-nullsafety.2" + version: "1.4.4+1" hive_generator: dependency: "direct dev" description: @@ -403,6 +417,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.3" + pointycastle: + dependency: transitive + description: + name: pointycastle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" pool: dependency: transitive description: @@ -512,7 +533,7 @@ packages: name: time url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "1.4.1" timing: dependency: transitive description: diff --git a/cw_core/pubspec.yaml b/cw_core/pubspec.yaml index faafca9a8..4caa92e11 100644 --- a/cw_core/pubspec.yaml +++ b/cw_core/pubspec.yaml @@ -1,8 +1,9 @@ name: cw_core description: A new Flutter package project. version: 0.0.1 -author: -homepage: +publish_to: none +author: Cake Wallet +homepage: https://cakewallet.com environment: sdk: ">=2.7.0 <3.0.0" @@ -16,6 +17,7 @@ dependencies: mobx: ^1.2.1+2 flutter_mobx: ^1.1.0+2 intl: ^0.17.0 + encrypt: ^4.0.0 dev_dependencies: flutter_test: diff --git a/cw_monero/pubspec.yaml b/cw_monero/pubspec.yaml index 4967c1e5f..29584e194 100644 --- a/cw_monero/pubspec.yaml +++ b/cw_monero/pubspec.yaml @@ -1,8 +1,9 @@ name: cw_monero description: A new flutter plugin project. version: 0.0.1 -author: -homepage: +publish_to: none +author: Cake Wallet +homepage: https://cakewallet.com environment: sdk: ">=2.6.0 <3.0.0"