mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-24 20:39:21 +00:00
24 lines
543 B
Dart
24 lines
543 B
Dart
|
enum TorPlainNetworkOption {
|
||
|
tor,
|
||
|
clear,
|
||
|
both;
|
||
|
|
||
|
bool allowsTor() => this == tor || this == both;
|
||
|
bool allowsClear() => this == clear || this == both;
|
||
|
|
||
|
static TorPlainNetworkOption fromNodeData(
|
||
|
bool torEnabled,
|
||
|
bool clearEnabled,
|
||
|
) {
|
||
|
if (clearEnabled && torEnabled) {
|
||
|
return TorPlainNetworkOption.both;
|
||
|
} else if (torEnabled) {
|
||
|
return TorPlainNetworkOption.tor;
|
||
|
} else if (clearEnabled) {
|
||
|
return TorPlainNetworkOption.clear;
|
||
|
} else {
|
||
|
return TorPlainNetworkOption.both;
|
||
|
}
|
||
|
}
|
||
|
}
|