Skip to content

Update main to v0.9.2 #739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2e67988
bandaid fix xmr/wow address not showing up on recdeive screen on firs…
julian-CStack Jan 18, 2024
85a8b12
flutter version upgrade
julian-CStack Jan 18, 2024
d421e57
Merge pull request #723 from cypherstack/flutter_upgrade
julian-CStack Jan 18, 2024
18b202e
update version of spark lib
julian-CStack Jan 19, 2024
19f33ec
Merge pull request #724 from cypherstack/update_spark_lib_ref
julian-CStack Jan 19, 2024
795fde2
QoL script fixes
julian-CStack Jan 19, 2024
2c62bbe
set lelantusCoinIsarRescanRequired to false for new/restored from see…
julian-CStack Jan 19, 2024
0e0b516
Merge pull request #725 from cypherstack/firo_mobile_fix
julian-CStack Jan 19, 2024
d72e3a0
add/show spark balance where appropriate
julian-CStack Jan 21, 2024
11f55fb
Merge pull request #726 from cypherstack/firo_balance_fav_card_fix
julian-CStack Jan 21, 2024
7796841
add Julian's error handling in flutter_libepiccash
sneurlax Jan 22, 2024
f52b950
avoid updating wallet info before finishing opening
sneurlax Jan 23, 2024
7f6b069
replace simple return with an await open
sneurlax Jan 23, 2024
cf7cbd3
update flutter_libepiccash ref
sneurlax Jan 23, 2024
ec36386
Merge pull request #728 from cypherstack/monero
rehrar Jan 23, 2024
aa88b9a
Merge pull request #729 from cypherstack/epic
rehrar Jan 23, 2024
5bc2f91
fix tests: upgrade flutter to 3.16.0
sneurlax Jan 23, 2024
8e7523f
do not validate "p" (P2SH) addresses
sneurlax Jan 23, 2024
ad943ad
Merge pull request #731 from cypherstack/bch-p2sh
rehrar Jan 23, 2024
afb4a9c
Merge pull request #730 from cypherstack/actions
rehrar Jan 23, 2024
0f8d3eb
Update version (v1.9.1, build 200)
rehrar Jan 23, 2024
ec9cec5
refactor app bar
sneurlax Jan 24, 2024
4aed728
refactor view body
sneurlax Jan 24, 2024
ce2bc33
use SingleChildScrollView on desktop, too
sneurlax Jan 24, 2024
cd9ac3c
WIP working horizontal centering
sneurlax Jan 24, 2024
3c8e220
Merge pull request #732 from cypherstack/ui
rehrar Jan 24, 2024
0ff37d1
patch json request test
sneurlax Jan 26, 2024
fe819b7
disable emoji tap test
sneurlax Jan 26, 2024
0ef372c
fix details tap test
sneurlax Jan 26, 2024
7ea54d9
fix connect tap test
sneurlax Jan 26, 2024
6394295
fix desktop dialog close button test
sneurlax Jan 26, 2024
9cd452f
fix stack dialog test
sneurlax Jan 26, 2024
6846bbb
fix electrumx getUsedCoinSerials test
sneurlax Jan 26, 2024
4f29308
spray and pray
julian-CStack Jan 27, 2024
fcf9719
Fix rpc timeout issue and improved logging
julian-CStack Jan 29, 2024
cb29144
Merge pull request #736 from cypherstack/rpc
julian-CStack Jan 29, 2024
0f8e0db
Merge branch 'staging' into monero_changes
julian-CStack Jan 29, 2024
cd03849
Merge pull request #735 from cypherstack/monero_changes
julian-CStack Jan 29, 2024
e856fd9
Merge pull request #737 from cypherstack/tests
rehrar Jan 29, 2024
9f03f7c
Revert "Merge pull request #732 from cypherstack/ui"
sneurlax Jan 29, 2024
10a6706
wrap recovery phrase warning view in scroll and center views
sneurlax Jan 29, 2024
3fce0dd
Merge pull request #738 from cypherstack/ui
rehrar Jan 29, 2024
7d18220
Update version (v1.9.2, build 201)
rehrar Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.10.6'
flutter-version: '3.16.0'
channel: 'stable'
- name: Setup | Rust
uses: ATiltedTree/setup-rust@v1
Expand Down
2 changes: 1 addition & 1 deletion crypto_plugins/flutter_libepiccash
Submodule flutter_libepiccash updated 1 files
+137 −127 lib/lib.dart
107 changes: 66 additions & 41 deletions lib/electrumx_rpc/rpc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,32 @@ class JsonRPC {
void _sendNextAvailableRequest() {
_requestQueue.nextIncompleteReq.then((req) {
if (req != null) {
// \r\n required by electrumx server
if (_socket != null) {
if (!Prefs.instance.useTor) {
if (_socket == null) {
Logging.instance.log(
"JsonRPC _sendNextAvailableRequest attempted with"
" _socket=null on $host:$port",
level: LogLevel.Error,
);
}
// \r\n required by electrumx server
_socket!.write('${req.jsonRequest}\r\n');
}
if (_socksSocket != null) {
_socksSocket!.write('${req.jsonRequest}\r\n');
} else {
if (_socksSocket == null) {
Logging.instance.log(
"JsonRPC _sendNextAvailableRequest attempted with"
" _socksSocket=null on $host:$port",
level: LogLevel.Error,
);
}
// \r\n required by electrumx server
_socksSocket?.write('${req.jsonRequest}\r\n');
}

// TODO different timeout length?
req.initiateTimeout(
onTimedOut: () {
_requestQueue.remove(req);
_onReqCompleted(req);
},
);
}
Expand All @@ -109,7 +123,7 @@ class JsonRPC {
"JsonRPC request: opening socket $host:$port",
level: LogLevel.Info,
);
await connect().timeout(requestTimeout, onTimeout: () {
await _connect().timeout(requestTimeout, onTimeout: () {
throw Exception("Request timeout: $jsonRpcRequest");
});
}
Expand All @@ -119,7 +133,7 @@ class JsonRPC {
"JsonRPC request: opening SOCKS socket to $host:$port",
level: LogLevel.Info,
);
await connect().timeout(requestTimeout, onTimeout: () {
await _connect().timeout(requestTimeout, onTimeout: () {
throw Exception("Request timeout: $jsonRpcRequest");
});
}
Expand Down Expand Up @@ -156,23 +170,42 @@ class JsonRPC {
return future;
}

Future<void> disconnect({required String reason}) async {
await _requestMutex.protect(() async {
await _subscription?.cancel();
_subscription = null;
_socket?.destroy();
_socket = null;
await _socksSocket?.close();
_socksSocket = null;

// clean up remaining queue
await _requestQueue.completeRemainingWithError(
"JsonRPC disconnect() called with reason: \"$reason\"",
);
});
/// DO NOT set [ignoreMutex] to true unless fully aware of the consequences
Future<void> disconnect({
required String reason,
bool ignoreMutex = false,
}) async {
if (ignoreMutex) {
await _disconnectHelper(reason: reason);
} else {
await _requestMutex.protect(() async {
await _disconnectHelper(reason: reason);
});
}
}

Future<void> _disconnectHelper({required String reason}) async {
await _subscription?.cancel();
_subscription = null;
_socket?.destroy();
_socket = null;
await _socksSocket?.close();
_socksSocket = null;

// clean up remaining queue
await _requestQueue.completeRemainingWithError(
"JsonRPC disconnect() called with reason: \"$reason\"",
);
}

Future<void> connect() async {
Future<void> _connect() async {
// ignore mutex is set to true here as _connect is already called within
// the mutex.protect block. Setting to false here leads to a deadlock
await disconnect(
reason: "New connection requested",
ignoreMutex: true,
);

if (!Prefs.instance.useTor) {
if (useSSL) {
_socket = await SecureSocket.connect(
Expand Down Expand Up @@ -352,17 +385,20 @@ class _JsonRPCRequest {
}

void initiateTimeout({
VoidCallback? onTimedOut,
required VoidCallback onTimedOut,
}) {
Future<void>.delayed(requestTimeout).then((_) {
if (!isComplete) {
try {
throw JsonRpcException("_JsonRPCRequest timed out: $jsonRequest");
} catch (e, s) {
completer.completeError(e, s);
onTimedOut?.call();
}
completer.complete(
JsonRPCResponse(
data: null,
exception: JsonRpcException(
"_JsonRPCRequest timed out: $jsonRequest",
),
),
);
}
onTimedOut.call();
});
}

Expand All @@ -375,14 +411,3 @@ class JsonRPCResponse {

JsonRPCResponse({this.data, this.exception});
}

bool isIpAddress(String host) {
try {
// if the string can be parsed into an InternetAddress, it's an IP.
InternetAddress(host);
return true;
} catch (e) {
// if parsing fails, it's not an IP.
return false;
}
}
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,8 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
break;
case AppLifecycleState.detached:
break;
case AppLifecycleState.hidden:
break;
}
}

Expand Down
Loading