diff --git a/lolnode/lib/config.dart b/lolnode/lib/config.dart
index 38c59b1..e9fa0e1 100644
--- a/lolnode/lib/config.dart
+++ b/lolnode/lib/config.dart
@@ -19,7 +19,6 @@ along with CyberWOW. If not, see .
*/
-import 'config/prototype.dart';
import 'config/lolnode.dart' as cryptoConfig;
final c = cryptoConfig.config;
@@ -39,4 +38,3 @@ const stdoutLineBufferSize = 200;
const bannerShownKey = 'banner-shown';
const int maxPoolTxSize = 5000;
-
diff --git a/lolnode/lib/logic/controller/process/run.dart b/lolnode/lib/logic/controller/process/run.dart
index b572fd4..caebeac 100644
--- a/lolnode/lib/logic/controller/process/run.dart
+++ b/lolnode/lib/logic/controller/process/run.dart
@@ -32,37 +32,32 @@ import '../../sensor/helper.dart' as helper;
typedef ShouldExit = bool Function();
-Stream runBinary
-(
- final String name,
- { final Stream input,
- final ShouldExit shouldExit,
- final List userArgs = const [],
- }
-) async* {
+Stream runBinary(
+ final String name, {
+ final Stream input,
+ final ShouldExit shouldExit,
+ final List userArgs = const [],
+}) async* {
final binPath = await helper.getBinaryPath(name);
final appDocDir = await getApplicationDocumentsDirectory();
- final appDocPath = appDocDir.path;
final binDir = Directory(appDocDir.path + "/" + config.c.appPath);
await binDir.create();
// print('binDir: ' + binDir.path);
- const List debugArgs =
- [
- ];
- const List releaseArgs =
- [
- ];
+ const List debugArgs = [];
+ const List releaseArgs = [];
const extraArgs = kReleaseMode ? releaseArgs : debugArgs;
- final args =
- [
- "--data-dir",
- binDir.path,
- ] + extraArgs + config.c.extraArgs + userArgs;
+ final args = [
+ "--data-dir",
+ binDir.path,
+ ] +
+ extraArgs +
+ config.c.extraArgs +
+ userArgs;
log.info('args: ' + args.toString());
@@ -81,7 +76,8 @@ Stream runBinary
}
final _stdout = outputProcess.stdout
- .transform(utf8.decoder).transform(const LineSplitter());
+ .transform(utf8.decoder)
+ .transform(const LineSplitter());
await for (final line in _stdout) {
log.finest('process output: ' + line);
diff --git a/lolnode/lib/logic/controller/refresh.dart b/lolnode/lib/logic/controller/refresh.dart
index 8f6c20d..7d05ff5 100644
--- a/lolnode/lib/logic/controller/refresh.dart
+++ b/lolnode/lib/logic/controller/refresh.dart
@@ -19,21 +19,19 @@ along with CyberWOW. If not, see .
*/
-import 'package:logging/logging.dart';
-
import 'dart:ui';
import 'dart:async';
-import '../../config.dart';
import '../../logging.dart';
import '../../helper.dart';
typedef GetNotificationFunc = AppLifecycleState Function();
-Stream pull(GetNotificationFunc getNotification, final String puller) async* {
+Stream pull(
+ GetNotificationFunc getNotification, final String puller) async* {
while (true) {
final _appState = getNotification();
- log.finer('refresh pull by ${puller}: app state: ${_appState}');
+ log.finer('refresh pull by $puller: app state: $_appState');
if (_appState == AppLifecycleState.resumed) {
yield null;
diff --git a/lolnode/lib/logic/interface/rpc/rpc2.dart b/lolnode/lib/logic/interface/rpc/rpc2.dart
index 58c28d4..bb611d0 100644
--- a/lolnode/lib/logic/interface/rpc/rpc2.dart
+++ b/lolnode/lib/logic/interface/rpc/rpc2.dart
@@ -25,22 +25,20 @@ import 'dart:math';
import 'package:http/http.dart' as http;
import 'package:flutter/foundation.dart';
-import 'package:intl/intl.dart';
import '../../../config.dart' as config;
import '../../../helper.dart';
import '../../../logging.dart';
Future rpc2(final String method) async {
- final url = 'http://${config.host}:${config.c.port}/${method}';
+ final url = 'http://${config.host}:${config.c.port}/$method';
try {
- final response = await http.post
- ( url,
+ final response = await http.post(
+ url,
);
return response;
- }
- catch (e) {
+ } catch (e) {
log.warning(e);
return null;
}
@@ -57,7 +55,7 @@ Future rpc2String(final String method, {final String field}) async {
return '';
} else {
final _body = await compute(jsonDecode, response.body);
- final _field = field == null ? _body: _body[field];
+ final _field = field == null ? _body : _body[field];
return pretty(_field);
}
diff --git a/lolnode/lib/logic/sensor/daemon.dart b/lolnode/lib/logic/sensor/daemon.dart
index e8ee278..e543576 100644
--- a/lolnode/lib/logic/sensor/daemon.dart
+++ b/lolnode/lib/logic/sensor/daemon.dart
@@ -20,7 +20,6 @@ along with CyberWOW. If not, see .
*/
import 'dart:async';
-import 'dart:convert';
import 'rpc/rpc.dart' as rpc;
import '../../config.dart' as config;
@@ -28,14 +27,16 @@ import '../../logging.dart';
Future isConnected() async {
final _connections = await rpc.getConnectionsSimple();
- log.finer('cyberwow: _connections: ${_connections}');
- return !_connections.isEmpty;
+ log.finer('cyberwow: _connections: $_connections');
+ return _connections.isNotEmpty;
}
Future isSynced() async {
final _targetHeight = await rpc.targetHeight();
final _height = await rpc.height();
- return _targetHeight >= 0 && _targetHeight <= _height && _height > config.minimumHeight;
+ return _targetHeight >= 0 &&
+ _targetHeight <= _height &&
+ _height > config.minimumHeight;
}
Future isNotSynced() async {
diff --git a/lolnode/lib/logic/sensor/helper.dart b/lolnode/lib/logic/sensor/helper.dart
index 49742e2..37e7d5d 100644
--- a/lolnode/lib/logic/sensor/helper.dart
+++ b/lolnode/lib/logic/sensor/helper.dart
@@ -20,22 +20,13 @@ along with Wowllet. If not, see .
*/
import 'dart:async';
-import 'dart:io';
-import 'package:path_provider/path_provider.dart';
-import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
-import '../../logging.dart';
-
const _methodChannel = const MethodChannel('send-intent');
Future getBinaryDir() async {
final _dir = await _methodChannel.invokeMethod('getBinaryDir');
-
- final _binDir = Directory(_dir);
- final _bins = _binDir.listSync(recursive: true);
-
return _dir;
}
diff --git a/lolnode/lib/logic/sensor/rpc/rpc.dart b/lolnode/lib/logic/sensor/rpc/rpc.dart
index c806768..0a5b6ce 100644
--- a/lolnode/lib/logic/sensor/rpc/rpc.dart
+++ b/lolnode/lib/logic/sensor/rpc/rpc.dart
@@ -20,18 +20,17 @@ along with CyberWOW. If not, see .
*/
import 'dart:async';
-import 'dart:convert';
import 'package:http/http.dart' as http;
import '../../../helper.dart';
-import '../../../logging.dart';
import '../../interface/rpc/rpc.dart';
Future syncInfo() => rpc('sync_info');
Future syncInfoString() => rpcString('sync_info');
-Future targetHeight() => rpc('sync_info', field: 'target_height').then(asInt);
+Future targetHeight() =>
+ rpc('sync_info', field: 'target_height').then(asInt);
Future height() => rpc('sync_info', field: 'height').then(asInt);
Future getInfo() => rpc('get_info');
@@ -47,26 +46,24 @@ Future getInfoString() => rpcString('get_info');
Future offline() => rpc('get_info', field: 'offline').then(asBool);
Future outgoingConnectionsCount() =>
- rpc('get_info', field: 'outgoing_connections_count').then(asInt);
+ rpc('get_info', field: 'outgoing_connections_count').then(asInt);
Future incomingConnectionsCount() =>
- rpc('get_info', field: 'incoming_connections_count').then(asInt);
+ rpc('get_info', field: 'incoming_connections_count').then(asInt);
Future>> getConnectionsSimple() async {
- final _connections = await rpc('get_connections', field: 'connections').then(asJsonArray);
+ final _connections =
+ await rpc('get_connections', field: 'connections').then(asJsonArray);
const minActiveTime = 8;
- final _activeConnections = _connections.where((x) => x['live_time'] > minActiveTime);
+ final _activeConnections =
+ _connections.where((x) => x['live_time'] > minActiveTime);
- final _sortedConn = _activeConnections.toList()..sort
- (
- (x, y) {
+ final _sortedConn = _activeConnections.toList()
+ ..sort((x, y) {
final int a = x['live_time'];
final int b = y['live_time'];
return a.compareTo(b);
- }
- );
+ });
return _sortedConn.toList();
}
-
-
diff --git a/lolnode/lib/logic/sensor/rpc/rpc2.dart b/lolnode/lib/logic/sensor/rpc/rpc2.dart
index 5f21320..b94b22f 100644
--- a/lolnode/lib/logic/sensor/rpc/rpc2.dart
+++ b/lolnode/lib/logic/sensor/rpc/rpc2.dart
@@ -31,7 +31,8 @@ import '../../../config.dart' as config;
import '../../../logging.dart';
import '../../interface/rpc/rpc2.dart' as rpc2;
-Future getTransactionPool() async => rpc2.rpc2('get_transaction_pool');
+Future getTransactionPool() async =>
+ rpc2.rpc2('get_transaction_pool');
Map txInOutCache = {};
@@ -48,46 +49,41 @@ Future>> getTransactionPoolSimple() async {
} else {
final responseBody = json.decode(response.body);
final result = asJsonArray(responseBody['transactions']);
- final _sortedPool = result..sort
- (
- (x, y) {
+ final _sortedPool = result
+ ..sort((x, y) {
final int a = x['receive_time'];
final int b = y['receive_time'];
return b.compareTo(a);
+ });
+
+ final _decodedPool = Stream.fromIterable(_sortedPool).asyncMap((x) async {
+ if (txInOutCache.length > config.maxPoolTxSize) {
+ txInOutCache = {};
}
- );
- final _decodedPool = await Stream.fromIterable(_sortedPool).asyncMap
- (
- (x) async {
- if (txInOutCache.length > config.maxPoolTxSize) {
- txInOutCache = {};
- }
+ final _txid = x['id_hash'];
- final _txid = x['id_hash'];
+ if (txInOutCache[_txid] == null) {
+ final String _tx_json = x['tx_json'];
+ final _tx_json_decoded = await compute(jsonDecode, _tx_json);
- if (txInOutCache[_txid] == null) {
- final String _tx_json = x['tx_json'];
- final _tx_json_decoded = await compute(jsonDecode, _tx_json);
-
- final _inOut =
- {
- 'vin': _tx_json_decoded['vin'].length,
- 'vout': _tx_json_decoded['vout'].length,
- };
-
- final _inOutString = _inOut['vin'].toString() + '/' + _inOut['vout'].toString();
-
- txInOutCache[_txid] = _inOutString;
- log.fine('cached tx_json in pool for: ${_txid}');
- }
-
- return {
- ...x,
- ...{'i/o': txInOutCache[_txid]},
+ final _inOut = {
+ 'vin': _tx_json_decoded['vin'].length,
+ 'vout': _tx_json_decoded['vout'].length,
};
+
+ final _inOutString =
+ _inOut['vin'].toString() + '/' + _inOut['vout'].toString();
+
+ txInOutCache[_txid] = _inOutString;
+ log.fine('cached tx_json in pool for: $_txid');
}
- );
+
+ return {
+ ...x,
+ ...{'i/o': txInOutCache[_txid]},
+ };
+ });
return _decodedPool.toList();
}
diff --git a/lolnode/lib/logic/view/rpc/rpc.dart b/lolnode/lib/logic/view/rpc/rpc.dart
index 56e6a59..c7e9f4b 100644
--- a/lolnode/lib/logic/view/rpc/rpc.dart
+++ b/lolnode/lib/logic/view/rpc/rpc.dart
@@ -21,12 +21,10 @@ along with CyberWOW. If not, see .
import 'package:intl/intl.dart';
-import '../../../config.dart' as config;
import '../../../helper.dart';
Map getConnectionView(Map x) {
- const _remove =
- [
+ const _remove = [
'address_type',
'connection_id',
'ip',
@@ -50,44 +48,38 @@ Map getConnectionView(Map x) {
'incoming',
];
- final _filteredConn = x..removeWhere
- (
- (k,v) => _remove.contains(k)
- );
+ final _filteredConn = x..removeWhere((k, v) => _remove.contains(k));
- final _formattedConn = _filteredConn.map
- (
- (k, v) {
- switch (k) {
- case 'connection_id': {
+ final _formattedConn = _filteredConn.map((k, v) {
+ switch (k) {
+ case 'connection_id':
+ {
return MapEntry(k, trimHash(v));
}
- case 'live_time': {
+ case 'live_time':
+ {
final _duration = Duration(seconds: v);
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry(k, format(_duration));
}
- default: {
- const speedField =
- [
+ default:
+ {
+ const speedField = [
'avg_download',
'avg_upload',
'current_download',
'current_upload',
];
if (speedField.contains(k)) {
- return MapEntry(k, '${v} kB/s');
- }
- else {
+ return MapEntry(k, '$v kB/s');
+ } else {
return MapEntry(k, v);
}
}
- }
}
- );
+ });
- final List keys =
- [
+ final List keys = [
'host',
'height',
'live_time',
@@ -96,53 +88,36 @@ Map getConnectionView(Map x) {
'avg_download',
'avg_upload',
'pruning_seed',
- ]
- .where((k) => _formattedConn.keys.contains(k))
- .toList();
+ ].where((k) => _formattedConn.keys.contains(k)).toList();
- final _sortedConn = {
- for (final k in keys) k: _formattedConn[k]
- };
+ final _sortedConn = {for (final k in keys) k: _formattedConn[k]};
- final _cleanedUpConn = _sortedConn..removeWhere
- (
- (k,v) => k == 'pruning_seed' && x[k] == 0
- );
+ final _cleanedUpConn = _sortedConn
+ ..removeWhere((k, v) => k == 'pruning_seed' && x[k] == 0);
return _cleanedUpConn;
}
Map simpleHeight(int height, Map x) {
- return x.map
- (
- (k, v) {
- if (k == 'height') {
- if (v == 0) {
- return MapEntry(k, '☠');
- }
-
- else if (v < height) {
- return MapEntry(k, '-${height - v}');
- }
-
- else if (v == height) {
- return MapEntry(k, '✓');
- }
-
- else {
- return MapEntry(k, '+${v - height}');
- }
- }
- else {
- return MapEntry(k, v);
+ return x.map((k, v) {
+ if (k == 'height') {
+ if (v == 0) {
+ return MapEntry(k, '☠');
+ } else if (v < height) {
+ return MapEntry(k, '-${height - v}');
+ } else if (v == height) {
+ return MapEntry(k, '✓');
+ } else {
+ return MapEntry(k, '+${v - height}');
}
+ } else {
+ return MapEntry(k, v);
}
- );
+ });
}
Map getInfoView(Map x) {
- const _remove =
- [
+ const _remove = [
'difficulty_top64',
'stagenet',
'testnet',
@@ -157,10 +132,7 @@ Map getInfoView(Map x) {
'credits',
];
- final _filteredInfo = x..removeWhere
- (
- (k,v) => _remove.contains(k)
- );
+ final _filteredInfo = x..removeWhere((k, v) => _remove.contains(k));
final int _difficulty = _filteredInfo['difficulty'] ?? 0;
final Map _hashRate = {'hash_rate': _difficulty / 300};
@@ -169,23 +141,23 @@ Map getInfoView(Map x) {
..._hashRate,
};
- final _formattedInfo = _ammendedInfo.map
- (
- (k, v) {
- switch (k) {
- case 'top_block_hash': {
+ final _formattedInfo = _ammendedInfo.map((k, v) {
+ switch (k) {
+ case 'top_block_hash':
+ {
return MapEntry(k, trimHash(v));
}
- case 'start_time': {
+ case 'start_time':
+ {
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
final _diff = DateTime.now().difference(_receive_time);
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry('uptime', format(_diff));
}
- default: {
- const sizeField =
- [
+ default:
+ {
+ const sizeField = [
'block_size_limit',
'block_size_median',
'block_weight_limit',
@@ -200,27 +172,20 @@ Map getInfoView(Map x) {
if (sizeField.contains(k)) {
final formatter = NumberFormat.compact();
return MapEntry(k, formatter.format(v));
- }
- else {
+ } else {
return MapEntry(k, v);
}
}
- }
}
- );
+ });
- final _cleanedUpInfo = _formattedInfo.map
- (
- (k, v) {
- if (k.contains('_count') && k != 'tx_count') {
- return MapEntry(k.replaceAll('_count', ''), v);
- }
-
- else {
- return MapEntry(k, v);
- }
+ final _cleanedUpInfo = _formattedInfo.map((k, v) {
+ if (k.contains('_count') && k != 'tx_count') {
+ return MapEntry(k.replaceAll('_count', ''), v);
+ } else {
+ return MapEntry(k, v);
}
- );
+ });
final _sortedInfo = {
for (final k in _cleanedUpInfo.keys.toList()..sort()) k: _cleanedUpInfo[k]
diff --git a/lolnode/lib/logic/view/rpc/rpc2.dart b/lolnode/lib/logic/view/rpc/rpc2.dart
index 34c2a06..2641569 100644
--- a/lolnode/lib/logic/view/rpc/rpc2.dart
+++ b/lolnode/lib/logic/view/rpc/rpc2.dart
@@ -23,12 +23,10 @@ import 'dart:math';
import 'package:intl/intl.dart';
-import '../../../config.dart' as config;
import '../../../helper.dart';
Map txView(Map x) {
- const _remove =
- [
+ const _remove = [
'tx_blob',
// 'tx_json',
'last_failed_id_hash',
@@ -45,57 +43,44 @@ Map txView(Map x) {
// 'blob_size',
];
- final _filteredTx = x..removeWhere
- (
- (k,v) => _remove.contains(k)
- );
+ final _filteredTx = x..removeWhere((k, v) => _remove.contains(k));
- final _formattedTx = _filteredTx.map
- (
- (k, v) {
- switch (k) {
- case 'id_hash':
- return MapEntry('id', trimHash(v));
- case 'blob_size':
- return MapEntry('size', (v / 1024).toStringAsFixed(2) + ' kB');
- case 'fee': {
- final formatter = NumberFormat.currency
- (
+ final _formattedTx = _filteredTx.map((k, v) {
+ switch (k) {
+ case 'id_hash':
+ return MapEntry('id', trimHash(v));
+ case 'blob_size':
+ return MapEntry('size', (v / 1024).toStringAsFixed(2) + ' kB');
+ case 'fee':
+ {
+ final formatter = NumberFormat.currency(
symbol: '',
decimalDigits: 2,
);
return MapEntry(k, formatter.format(v / pow(10, 11)) + ' ⍵');
}
- case 'receive_time': {
+ case 'receive_time':
+ {
final _receive_time = DateTime.fromMillisecondsSinceEpoch(v * 1000);
final _diff = DateTime.now().difference(_receive_time);
format(Duration d) => d.toString().split('.').first.padLeft(8, "0");
return MapEntry('age', format(_diff));
}
- default:
- return MapEntry(k, v);
- }
+ default:
+ return MapEntry(k, v);
}
+ });
-
-
- );
-
- final List keys =
- [
+ final List keys = [
'id',
'age',
'fee',
'i/o',
'size',
- ]
- .where((k) => _formattedTx.keys.contains(k))
- .toList();
+ ].where((k) => _formattedTx.keys.contains(k)).toList();
- final _sortedTx = {
- for (final k in keys) k: _formattedTx[k]
- };
+ final _sortedTx = {for (final k in keys) k: _formattedTx[k]};
return _sortedTx;
}
diff --git a/lolnode/lib/main.dart b/lolnode/lib/main.dart
index a440236..8719244 100644
--- a/lolnode/lib/main.dart
+++ b/lolnode/lib/main.dart
@@ -36,7 +36,7 @@ import 'widget.dart' as widget;
void main() {
Logger.root.level = kReleaseMode ? Level.INFO : Level.FINE;
Logger.root.onRecord.listen((LogRecord rec) {
- print('${rec.level.name}: ${rec.time}: ${rec.message}');
+ print('${rec.level.name}: ${rec.time}: ${rec.message}');
});
runApp(CyberWOW_App());
}
@@ -47,8 +47,7 @@ class CyberWOW_App extends StatelessWidget {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
- return MaterialApp
- (
+ return MaterialApp(
title: 'CyberWOW',
theme: config.c.theme,
darkTheme: config.c.theme,
@@ -65,8 +64,8 @@ class CyberWOW_Page extends StatefulWidget {
_CyberWOW_PageState createState() => _CyberWOW_PageState();
}
-class _CyberWOW_PageState extends State with WidgetsBindingObserver
-{
+class _CyberWOW_PageState extends State
+ with WidgetsBindingObserver {
// AppState _state = LoadingState("init...");
static const _channel = const MethodChannel('send-intent');
@@ -86,7 +85,9 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
@override
void didChangeAppLifecycleState(final AppLifecycleState state) {
log.fine('app cycle: ${state}');
- setState(() { _notification = state; });
+ setState(() {
+ _notification = state;
+ });
}
@override
@@ -96,10 +97,7 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
}
void _setState(final state.AppState newState) {
- setState
- (
- () => _state = newState
- );
+ setState(() => _state = newState);
}
AppLifecycleState _getNotification() {
@@ -110,10 +108,6 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
return _exiting;
}
- state.AppState _getState() {
- return _state;
- }
-
Future buildStateMachine(final state.BlankState _blankState) async {
final loadingText = config.c.splash;
state.LoadingState _loadingState = await _blankState.next(loadingText);
@@ -121,24 +115,23 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
final _initialIntent = await getInitialIntent();
final _userArgs = _initialIntent
- .trim()
- .split(RegExp(r"\s+"))
- .where((x) => !x.isEmpty)
- .toList();
+ .trim()
+ .split(RegExp(r"\s+"))
+ .where((x) => x.isNotEmpty)
+ .toList();
- if (!_userArgs.isEmpty) {
- log.info('user args: ${_userArgs}');
+ if (_userArgs.isNotEmpty) {
+ log.info('user args: $_userArgs');
}
final syncing = process
- .runBinary
- (
- config.c.outputBin,
- input: inputStreamController.stream,
- shouldExit: _isExiting,
- userArgs: _userArgs,
- )
- .asBroadcastStream();
+ .runBinary(
+ config.c.outputBin,
+ input: inputStreamController.stream,
+ shouldExit: _isExiting,
+ userArgs: _userArgs,
+ )
+ .asBroadcastStream();
await _syncingState.next(inputStreamController.sink, syncing);
@@ -147,12 +140,13 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
while (validState && !exited) {
switch (_state.runtimeType) {
- case state.ExitingState: {
- await (_state as state.ExitingState).wait();
- log.finer('exit state wait done');
- exited = true;
- }
- break;
+ case state.ExitingState:
+ {
+ await (_state as state.ExitingState).wait();
+ log.finer('exit state wait done');
+ exited = true;
+ }
+ break;
case state.SyncedState:
await (_state as state.SyncedState).next();
@@ -162,7 +156,8 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
await (_state as state.ReSyncingState).next();
break;
- default: validState = false;
+ default:
+ validState = false;
}
}
@@ -185,7 +180,8 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
WidgetsBinding.instance.addObserver(this);
- final state.AppHook _appHook = state.AppHook(_setState, _getNotification, _isExiting);
+ final state.AppHook _appHook =
+ state.AppHook(_setState, _getNotification, _isExiting);
final state.BlankState _blankState = state.BlankState(_appHook);
_state = _blankState;
@@ -208,8 +204,7 @@ class _CyberWOW_PageState extends State with WidgetsBindingObserv
@override
Widget build(final BuildContext context) {
- return WillPopScope
- (
+ return WillPopScope(
onWillPop: () => _exitApp(context),
child: widget.build(context, _state),
);
diff --git a/lolnode/lib/state/loading.dart b/lolnode/lib/state/loading.dart
index 2fd8751..4e2daf2 100644
--- a/lolnode/lib/state/loading.dart
+++ b/lolnode/lib/state/loading.dart
@@ -22,7 +22,6 @@ along with CyberWOW. If not, see .
import 'package:shared_preferences/shared_preferences.dart';
import '../config.dart' as config;
-import '../logging.dart';
import '../helper.dart';
import 'prototype.dart';
@@ -32,7 +31,7 @@ class LoadingState extends AppState {
final String banner;
String status = '';
- LoadingState(appHook, this.banner) : super (appHook);
+ LoadingState(appHook, this.banner) : super(appHook);
void append(final String msg) {
this.status += msg;
@@ -41,7 +40,8 @@ class LoadingState extends AppState {
Future next() async {
Future showBanner() async {
- final Iterable chars = banner.runes.map((x) => String.fromCharCode(x));
+ final Iterable chars =
+ banner.runes.map((x) => String.fromCharCode(x));
for (final String char in chars) {
append(char);
@@ -53,7 +53,7 @@ class LoadingState extends AppState {
}
SharedPreferences _prefs = await SharedPreferences.getInstance();
- final _bannerShown = await _prefs.getBool(config.bannerShownKey);
+ final _bannerShown = _prefs.getBool(config.bannerShownKey);
if (_bannerShown == null) {
await showBanner();
diff --git a/lolnode/lib/state/resyncing.dart b/lolnode/lib/state/resyncing.dart
index fd2569e..9aee304 100644
--- a/lolnode/lib/state/resyncing.dart
+++ b/lolnode/lib/state/resyncing.dart
@@ -32,7 +32,6 @@ import 'prototype.dart';
import 'synced.dart';
import 'exiting.dart';
-
class ReSyncingState extends AppState {
final Queue stdout;
final StreamSink processInput;
@@ -41,8 +40,9 @@ class ReSyncingState extends AppState {
bool synced = false;
- ReSyncingState(appHook, this.stdout, this.processInput, this.processOutput, this.pageIndex)
- : super (appHook);
+ ReSyncingState(appHook, this.stdout, this.processInput, this.processOutput,
+ this.pageIndex)
+ : super(appHook);
void append(final String msg) {
stdout.addLast(msg);
@@ -65,7 +65,8 @@ class ReSyncingState extends AppState {
}
Future checkSync() async {
- await for (final _null in refresh.pull(appHook.getNotification, 'ReSyncingState')) {
+ await for (final _
+ in refresh.pull(appHook.getNotification, 'ReSyncingState')) {
if (appHook.isExiting()) {
log.fine('ReSyncing state detected exiting');
break;
@@ -83,18 +84,13 @@ class ReSyncingState extends AppState {
await checkSync();
if (appHook.isExiting()) {
- ExitingState _next = ExitingState
- (
- appHook, stdout, processOutput
- );
+ ExitingState _next = ExitingState(appHook, stdout, processOutput);
return moveState(_next);
}
log.fine('resync: await exit');
- SyncedState _next = SyncedState
- (
- appHook, stdout, processInput, processOutput, pageIndex
- );
+ SyncedState _next =
+ SyncedState(appHook, stdout, processInput, processOutput, pageIndex);
_next.height = await rpc.height();
return moveState(_next);
}
diff --git a/lolnode/lib/state/synced.dart b/lolnode/lib/state/synced.dart
index 15d4f0d..4d48bba 100644
--- a/lolnode/lib/state/synced.dart
+++ b/lolnode/lib/state/synced.dart
@@ -19,7 +19,6 @@ along with CyberWOW. If not, see .
*/
-
import 'dart:async';
import 'dart:collection';
@@ -60,9 +59,10 @@ class SyncedState extends AppState {
String getConnectionsCache = '';
String getTransactionPoolCache = '';
- SyncedState(appHook, this.stdout, this.processInput, this.processOutput, this.pageIndex)
- : super (appHook) {
- pageController = PageController( initialPage: pageIndex );
+ SyncedState(appHook, this.stdout, this.processInput, this.processOutput,
+ this.pageIndex)
+ : super(appHook) {
+ pageController = PageController(initialPage: pageIndex);
}
void appendInput(final String line) {
@@ -102,8 +102,9 @@ class SyncedState extends AppState {
logStdout();
- Future checkSync() async {
- await for (final _null in refresh.pull(appHook.getNotification, 'syncedState')) {
+ Future checkSync() async {
+ await for (final _
+ in refresh.pull(appHook.getNotification, 'syncedState')) {
if (appHook.isExiting() || userExit) {
log.fine('Synced state detected exiting');
break;
@@ -121,17 +122,16 @@ class SyncedState extends AppState {
getInfoCache = pretty(_getInfoView);
getConnections = await rpc.getConnectionsSimple();
- final List