mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-24 12:29:37 +00:00
23 lines
543 B
Dart
23 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;
|
|
}
|
|
}
|
|
}
|