DesktopSecureStore implementation using Isar as backend, renamed FlutterSecureStorageInterface

This commit is contained in:
julian 2022-11-09 17:48:43 -06:00
parent 2bdf5f152c
commit 3ee0e97628
56 changed files with 1306 additions and 165 deletions

View file

@ -0,0 +1,18 @@
import 'package:isar/isar.dart';
part 'encrypted_string_value.g.dart';
@Collection()
class EncryptedStringValue {
Id id = Isar.autoIncrement;
@Index(unique: true, replace: true)
late String key;
late String value;
@override
String toString() {
return "EncryptedStringValue {\n key=$key\n value=$value\n}";
}
}

View file

@ -0,0 +1,748 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'encrypted_string_value.dart';
// **************************************************************************
// IsarCollectionGenerator
// **************************************************************************
// coverage:ignore-file
// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, join_return_with_assignment, avoid_js_rounded_ints, prefer_final_locals
extension GetEncryptedStringValueCollection on Isar {
IsarCollection<EncryptedStringValue> get encryptedStringValues =>
this.collection();
}
const EncryptedStringValueSchema = CollectionSchema(
name: r'EncryptedStringValue',
id: 4826543019451092626,
properties: {
r'key': PropertySchema(
id: 0,
name: r'key',
type: IsarType.string,
),
r'value': PropertySchema(
id: 1,
name: r'value',
type: IsarType.string,
)
},
estimateSize: _encryptedStringValueEstimateSize,
serializeNative: _encryptedStringValueSerializeNative,
deserializeNative: _encryptedStringValueDeserializeNative,
deserializePropNative: _encryptedStringValueDeserializePropNative,
serializeWeb: _encryptedStringValueSerializeWeb,
deserializeWeb: _encryptedStringValueDeserializeWeb,
deserializePropWeb: _encryptedStringValueDeserializePropWeb,
idName: r'id',
indexes: {
r'key': IndexSchema(
id: -4906094122524121629,
name: r'key',
unique: true,
replace: true,
properties: [
IndexPropertySchema(
name: r'key',
type: IndexType.hash,
caseSensitive: true,
)
],
)
},
links: {},
embeddedSchemas: {},
getId: _encryptedStringValueGetId,
getLinks: _encryptedStringValueGetLinks,
attach: _encryptedStringValueAttach,
version: 5,
);
int _encryptedStringValueEstimateSize(
EncryptedStringValue object,
List<int> offsets,
Map<Type, List<int>> allOffsets,
) {
var bytesCount = offsets.last;
bytesCount += 3 + object.key.length * 3;
bytesCount += 3 + object.value.length * 3;
return bytesCount;
}
int _encryptedStringValueSerializeNative(
EncryptedStringValue object,
IsarBinaryWriter writer,
List<int> offsets,
Map<Type, List<int>> allOffsets,
) {
writer.writeString(offsets[0], object.key);
writer.writeString(offsets[1], object.value);
return writer.usedBytes;
}
EncryptedStringValue _encryptedStringValueDeserializeNative(
int id,
IsarBinaryReader reader,
List<int> offsets,
Map<Type, List<int>> allOffsets,
) {
final object = EncryptedStringValue();
object.id = id;
object.key = reader.readString(offsets[0]);
object.value = reader.readString(offsets[1]);
return object;
}
P _encryptedStringValueDeserializePropNative<P>(
Id id,
IsarBinaryReader reader,
int propertyId,
int offset,
Map<Type, List<int>> allOffsets,
) {
switch (propertyId) {
case 0:
return (reader.readString(offset)) as P;
case 1:
return (reader.readString(offset)) as P;
default:
throw IsarError('Unknown property with id $propertyId');
}
}
Object _encryptedStringValueSerializeWeb(
IsarCollection<EncryptedStringValue> collection,
EncryptedStringValue object) {
/*final jsObj = IsarNative.newJsObject();*/ throw UnimplementedError();
}
EncryptedStringValue _encryptedStringValueDeserializeWeb(
IsarCollection<EncryptedStringValue> collection, Object jsObj) {
/*final object = EncryptedStringValue();object.id = IsarNative.jsObjectGet(jsObj, r'id') ?? (double.negativeInfinity as int);object.key = IsarNative.jsObjectGet(jsObj, r'key') ?? '';object.value = IsarNative.jsObjectGet(jsObj, r'value') ?? '';*/
//return object;
throw UnimplementedError();
}
P _encryptedStringValueDeserializePropWeb<P>(
Object jsObj, String propertyName) {
switch (propertyName) {
default:
throw IsarError('Illegal propertyName');
}
}
int? _encryptedStringValueGetId(EncryptedStringValue object) {
if (object.id == Isar.autoIncrement) {
return null;
} else {
return object.id;
}
}
List<IsarLinkBase<dynamic>> _encryptedStringValueGetLinks(
EncryptedStringValue object) {
return [];
}
void _encryptedStringValueAttach(
IsarCollection<dynamic> col, Id id, EncryptedStringValue object) {
object.id = id;
}
extension EncryptedStringValueByIndex on IsarCollection<EncryptedStringValue> {
Future<EncryptedStringValue?> getByKey(String key) {
return getByIndex(r'key', [key]);
}
EncryptedStringValue? getByKeySync(String key) {
return getByIndexSync(r'key', [key]);
}
Future<bool> deleteByKey(String key) {
return deleteByIndex(r'key', [key]);
}
bool deleteByKeySync(String key) {
return deleteByIndexSync(r'key', [key]);
}
Future<List<EncryptedStringValue?>> getAllByKey(List<String> keyValues) {
final values = keyValues.map((e) => [e]).toList();
return getAllByIndex(r'key', values);
}
List<EncryptedStringValue?> getAllByKeySync(List<String> keyValues) {
final values = keyValues.map((e) => [e]).toList();
return getAllByIndexSync(r'key', values);
}
Future<int> deleteAllByKey(List<String> keyValues) {
final values = keyValues.map((e) => [e]).toList();
return deleteAllByIndex(r'key', values);
}
int deleteAllByKeySync(List<String> keyValues) {
final values = keyValues.map((e) => [e]).toList();
return deleteAllByIndexSync(r'key', values);
}
Future<int> putByKey(EncryptedStringValue object) {
return putByIndex(r'key', object);
}
int putByKeySync(EncryptedStringValue object, {bool saveLinks = true}) {
return putByIndexSync(r'key', object, saveLinks: saveLinks);
}
Future<List<int>> putAllByKey(List<EncryptedStringValue> objects) {
return putAllByIndex(r'key', objects);
}
List<int> putAllByKeySync(List<EncryptedStringValue> objects,
{bool saveLinks = true}) {
return putAllByIndexSync(r'key', objects, saveLinks: saveLinks);
}
}
extension EncryptedStringValueQueryWhereSort
on QueryBuilder<EncryptedStringValue, EncryptedStringValue, QWhere> {
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhere>
anyId() {
return QueryBuilder.apply(this, (query) {
return query.addWhereClause(const IdWhereClause.any());
});
}
}
extension EncryptedStringValueQueryWhere
on QueryBuilder<EncryptedStringValue, EncryptedStringValue, QWhereClause> {
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhereClause>
idEqualTo(int id) {
return QueryBuilder.apply(this, (query) {
return query.addWhereClause(IdWhereClause.between(
lower: id,
upper: id,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhereClause>
idNotEqualTo(int id) {
return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) {
return query
.addWhereClause(
IdWhereClause.lessThan(upper: id, includeUpper: false),
)
.addWhereClause(
IdWhereClause.greaterThan(lower: id, includeLower: false),
);
} else {
return query
.addWhereClause(
IdWhereClause.greaterThan(lower: id, includeLower: false),
)
.addWhereClause(
IdWhereClause.lessThan(upper: id, includeUpper: false),
);
}
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhereClause>
idGreaterThan(int id, {bool include = false}) {
return QueryBuilder.apply(this, (query) {
return query.addWhereClause(
IdWhereClause.greaterThan(lower: id, includeLower: include),
);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhereClause>
idLessThan(int id, {bool include = false}) {
return QueryBuilder.apply(this, (query) {
return query.addWhereClause(
IdWhereClause.lessThan(upper: id, includeUpper: include),
);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhereClause>
idBetween(
int lowerId,
int upperId, {
bool includeLower = true,
bool includeUpper = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addWhereClause(IdWhereClause.between(
lower: lowerId,
includeLower: includeLower,
upper: upperId,
includeUpper: includeUpper,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhereClause>
keyEqualTo(String key) {
return QueryBuilder.apply(this, (query) {
return query.addWhereClause(IndexWhereClause.equalTo(
indexName: r'key',
value: [key],
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterWhereClause>
keyNotEqualTo(String key) {
return QueryBuilder.apply(this, (query) {
if (query.whereSort == Sort.asc) {
return query
.addWhereClause(IndexWhereClause.between(
indexName: r'key',
lower: [],
upper: [key],
includeUpper: false,
))
.addWhereClause(IndexWhereClause.between(
indexName: r'key',
lower: [key],
includeLower: false,
upper: [],
));
} else {
return query
.addWhereClause(IndexWhereClause.between(
indexName: r'key',
lower: [key],
includeLower: false,
upper: [],
))
.addWhereClause(IndexWhereClause.between(
indexName: r'key',
lower: [],
upper: [key],
includeUpper: false,
));
}
});
}
}
extension EncryptedStringValueQueryFilter on QueryBuilder<EncryptedStringValue,
EncryptedStringValue, QFilterCondition> {
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> idEqualTo(int value) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'id',
value: value,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> idGreaterThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'id',
value: value,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> idLessThan(
int value, {
bool include = false,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'id',
value: value,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> idBetween(
int lower,
int upper, {
bool includeLower = true,
bool includeUpper = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'id',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> keyEqualTo(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'key',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> keyGreaterThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'key',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> keyLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'key',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> keyBetween(
String lower,
String upper, {
bool includeLower = true,
bool includeUpper = true,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'key',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> keyStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'key',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> keyEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'key',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition>
keyContains(String value, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'key',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition>
keyMatches(String pattern, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'key',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> valueEqualTo(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'value',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> valueGreaterThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'value',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> valueLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'value',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> valueBetween(
String lower,
String upper, {
bool includeLower = true,
bool includeUpper = true,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'value',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> valueStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'value',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition> valueEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'value',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition>
valueContains(String value, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'value',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue,
QAfterFilterCondition>
valueMatches(String pattern, {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'value',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
}
extension EncryptedStringValueQueryObject on QueryBuilder<EncryptedStringValue,
EncryptedStringValue, QFilterCondition> {}
extension EncryptedStringValueQueryLinks on QueryBuilder<EncryptedStringValue,
EncryptedStringValue, QFilterCondition> {}
extension EncryptedStringValueQuerySortBy
on QueryBuilder<EncryptedStringValue, EncryptedStringValue, QSortBy> {
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
sortByKey() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'key', Sort.asc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
sortByKeyDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'key', Sort.desc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
sortByValue() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'value', Sort.asc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
sortByValueDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'value', Sort.desc);
});
}
}
extension EncryptedStringValueQuerySortThenBy
on QueryBuilder<EncryptedStringValue, EncryptedStringValue, QSortThenBy> {
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
thenById() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'id', Sort.asc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
thenByIdDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'id', Sort.desc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
thenByKey() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'key', Sort.asc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
thenByKeyDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'key', Sort.desc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
thenByValue() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'value', Sort.asc);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QAfterSortBy>
thenByValueDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'value', Sort.desc);
});
}
}
extension EncryptedStringValueQueryWhereDistinct
on QueryBuilder<EncryptedStringValue, EncryptedStringValue, QDistinct> {
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QDistinct>
distinctByKey({bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'key', caseSensitive: caseSensitive);
});
}
QueryBuilder<EncryptedStringValue, EncryptedStringValue, QDistinct>
distinctByValue({bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'value', caseSensitive: caseSensitive);
});
}
}
extension EncryptedStringValueQueryProperty on QueryBuilder<
EncryptedStringValue, EncryptedStringValue, QQueryProperty> {
QueryBuilder<EncryptedStringValue, int, QQueryOperations> idProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'id');
});
}
QueryBuilder<EncryptedStringValue, String, QQueryOperations> keyProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'key');
});
}
QueryBuilder<EncryptedStringValue, String, QQueryOperations> valueProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'value');
});
}
}

View file

@ -65,8 +65,7 @@ class NodeModel {
}
/// convenience getter to retrieve login password
Future<String?> getPassword(
FlutterSecureStorageInterface secureStorage) async {
Future<String?> getPassword(SecureStorageInterface secureStorage) async {
return await secureStorage.read(key: "${id}_nodePW");
}

View file

@ -54,7 +54,7 @@ class _CreatePinViewState extends ConsumerState<CreatePinView> {
final TextEditingController _pinPutController2 = TextEditingController();
final FocusNode _pinPutFocusNode2 = FocusNode();
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late Biometrics biometrics;
@override

View file

@ -158,7 +158,7 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
final _pinTextController = TextEditingController();
final FocusNode _pinFocusNode = FocusNode();
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late Biometrics biometrics;
Scaffold get _body => Scaffold(

View file

@ -634,7 +634,7 @@ class NodeForm extends ConsumerStatefulWidget {
}) : super(key: key);
final NodeModel? node;
final FlutterSecureStorageInterface secureStore;
final SecureStorageInterface secureStore;
final bool readOnly;
final Coin coin;
final void Function(bool canSave, bool canTestConnection)? onChanged;

View file

@ -45,7 +45,7 @@ class NodeDetailsView extends ConsumerStatefulWidget {
}
class _NodeDetailsViewState extends ConsumerState<NodeDetailsView> {
late final FlutterSecureStorageInterface secureStore;
late final SecureStorageInterface secureStore;
late final Coin coin;
late final String nodeId;
late final String popRouteName;

View file

@ -45,7 +45,7 @@ class _ChangePinViewState extends ConsumerState<ChangePinView> {
final TextEditingController _pinPutController2 = TextEditingController();
final FocusNode _pinPutFocusNode2 = FocusNode();
late final FlutterSecureStorageInterface _secureStore;
late final SecureStorageInterface _secureStore;
@override
void initState() {

View file

@ -41,7 +41,7 @@ class CreateAutoBackupView extends ConsumerStatefulWidget {
}
class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
late final FlutterSecureStorageInterface secureStore;
late final SecureStorageInterface secureStore;
late final TextEditingController fileLocationController;
late final TextEditingController passwordController;

View file

@ -40,7 +40,7 @@ class EditAutoBackupView extends ConsumerStatefulWidget {
}
class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
late final FlutterSecureStorageInterface secureStore;
late final SecureStorageInterface secureStore;
late final TextEditingController fileLocationController;
late final TextEditingController passwordController;

View file

@ -90,7 +90,7 @@ abstract class SWB {
static bool _checkShouldCancel(
PreRestoreState? revertToState,
FlutterSecureStorageInterface secureStorageInterface,
SecureStorageInterface secureStorageInterface,
) {
if (_shouldCancelRestore) {
if (revertToState != null) {
@ -193,7 +193,7 @@ abstract class SWB {
/// [secureStorage] parameter exposed for testing purposes
static Future<Map<String, dynamic>> createStackWalletJSON({
required FlutterSecureStorageInterface secureStorage,
required SecureStorageInterface secureStorage,
}) async {
Logging.instance
.log("Starting createStackWalletJSON...", level: LogLevel.Info);
@ -448,7 +448,7 @@ abstract class SWB {
Map<String, dynamic> validJSON,
StackRestoringUIState? uiState,
Map<String, String> oldToNewWalletIdMap,
FlutterSecureStorageInterface secureStorageInterface,
SecureStorageInterface secureStorageInterface,
) async {
Map<String, dynamic> prefs = validJSON["prefs"] as Map<String, dynamic>;
List<dynamic>? addressBookEntries =
@ -548,7 +548,7 @@ abstract class SWB {
static Future<bool?> restoreStackWalletJSON(
String jsonBackup,
StackRestoringUIState? uiState,
FlutterSecureStorageInterface secureStorageInterface,
SecureStorageInterface secureStorageInterface,
) async {
if (!Platform.isLinux) await Wakelock.enable();
@ -769,7 +769,7 @@ abstract class SWB {
static Future<void> _revert(
PreRestoreState revertToState,
FlutterSecureStorageInterface secureStorageInterface,
SecureStorageInterface secureStorageInterface,
) async {
Map<String, dynamic> prefs =
revertToState.validJSON["prefs"] as Map<String, dynamic>;
@ -1042,7 +1042,7 @@ abstract class SWB {
static Future<void> _restoreNodes(
List<dynamic>? nodes,
List<dynamic>? primaryNodes,
FlutterSecureStorageInterface secureStorageInterface,
SecureStorageInterface secureStorageInterface,
) async {
NodeService nodeService = NodeService(
secureStorageInterface: secureStorageInterface,

View file

@ -72,6 +72,11 @@ class _CreatePasswordViewState extends ConsumerState<CreatePasswordView> {
}
try {
if (await ref.read(storageCryptoHandlerProvider).hasPassword()) {
throw Exception(
"Tried creating a new password and attempted to overwrite an existing entry!");
}
await ref.read(storageCryptoHandlerProvider).initFromNew(passphrase);
} catch (e) {
unawaited(showFloatingFlushBar(

View file

@ -1,9 +1,15 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages_desktop_specific/forgot_password_desktop_view.dart';
import 'package:stackwallet/pages_desktop_specific/home/desktop_home_view.dart';
import 'package:stackwallet/providers/desktop/storage_crypto_handler_provider.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
@ -11,7 +17,7 @@ import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/stack_text_field.dart';
class DesktopLoginView extends StatefulWidget {
class DesktopLoginView extends ConsumerStatefulWidget {
const DesktopLoginView({
Key? key,
this.startupWalletId,
@ -22,10 +28,10 @@ class DesktopLoginView extends StatefulWidget {
final String? startupWalletId;
@override
State<DesktopLoginView> createState() => _DesktopLoginViewState();
ConsumerState<DesktopLoginView> createState() => _DesktopLoginViewState();
}
class _DesktopLoginViewState extends State<DesktopLoginView> {
class _DesktopLoginViewState extends ConsumerState<DesktopLoginView> {
late final TextEditingController passwordController;
late final FocusNode passwordFocusNode;
@ -153,13 +159,28 @@ class _DesktopLoginViewState extends State<DesktopLoginView> {
PrimaryButton(
label: "Continue",
enabled: _continueEnabled,
onPressed: () {
// todo auth
onPressed: () async {
try {
await ref
.read(storageCryptoHandlerProvider)
.initFromExisting(passwordController.text);
Navigator.of(context).pushNamedAndRemoveUntil(
DesktopHomeView.routeName,
(route) => false,
);
// if no errors passphrase is correct
if (mounted) {
unawaited(
Navigator.of(context).pushNamedAndRemoveUntil(
DesktopHomeView.routeName,
(route) => false,
),
);
}
} catch (e) {
await showFloatingFlushBar(
type: FlushBarType.warning,
message: e.toString(),
context: context,
);
}
},
),
const SizedBox(

View file

@ -4,11 +4,11 @@ import 'package:stackwallet/providers/desktop/storage_crypto_handler_provider.da
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/util.dart';
final secureStoreProvider = Provider<FlutterSecureStorageInterface>((ref) {
final secureStoreProvider = Provider<SecureStorageInterface>((ref) {
if (Util.isDesktop) {
final handler = ref.read(storageCryptoHandlerProvider).handler;
return SecureStorageWrapper(
store: DesktopPWStore(handler), isDesktop: true);
store: DesktopSecureStore(handler), isDesktop: true);
} else {
return const SecureStorageWrapper(
store: FlutterSecureStorage(),

View file

@ -24,7 +24,7 @@ class AutoSWBService extends ChangeNotifier {
bool _isActiveTimer = false;
bool get isActivePeriodicTimer => _isActiveTimer;
final FlutterSecureStorageInterface secureStorageInterface;
final SecureStorageInterface secureStorageInterface;
AutoSWBService({required this.secureStorageInterface});

View file

@ -1356,7 +1356,7 @@ class BitcoinWallet extends CoinServiceAPI {
CachedElectrumX get cachedElectrumXClient => _cachedElectrumXClient;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -1368,7 +1368,7 @@ class BitcoinWallet extends CoinServiceAPI {
required CachedElectrumX cachedClient,
required TransactionNotificationTracker tracker,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) {
txTracker = tracker;
_walletId = walletId;

View file

@ -1261,7 +1261,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
CachedElectrumX get cachedElectrumXClient => _cachedElectrumXClient;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -1273,7 +1273,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
required CachedElectrumX cachedClient,
required TransactionNotificationTracker tracker,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) {
txTracker = tracker;
_walletId = walletId;

View file

@ -25,7 +25,7 @@ abstract class CoinServiceAPI {
Coin coin,
String walletId,
String walletName,
FlutterSecureStorageInterface secureStorageInterface,
SecureStorageInterface secureStorageInterface,
NodeModel node,
TransactionNotificationTracker tracker,
Prefs prefs,

View file

@ -1124,7 +1124,7 @@ class DogecoinWallet extends CoinServiceAPI {
CachedElectrumX get cachedElectrumXClient => _cachedElectrumXClient;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -1136,7 +1136,7 @@ class DogecoinWallet extends CoinServiceAPI {
required CachedElectrumX cachedClient,
required TransactionNotificationTracker tracker,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) {
txTracker = tracker;
_walletId = walletId;

View file

@ -250,7 +250,7 @@ Future<String> _deleteWalletWrapper(String wallet) async {
Future<String> deleteEpicWallet({
required String walletId,
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) async {
String? config = await secureStore.read(key: '${walletId}_config');
if (Platform.isIOS) {
@ -517,7 +517,7 @@ class EpicCashWallet extends CoinServiceAPI {
required String walletName,
required Coin coin,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore}) {
required SecureStorageInterface secureStore}) {
_walletId = walletId;
_walletName = walletName;
_coin = coin;
@ -658,7 +658,7 @@ class EpicCashWallet extends CoinServiceAPI {
@override
Coin get coin => _coin;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;

View file

@ -1305,7 +1305,7 @@ class FiroWallet extends CoinServiceAPI {
late CachedElectrumX _cachedElectrumXClient;
CachedElectrumX get cachedElectrumXClient => _cachedElectrumXClient;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -1320,7 +1320,7 @@ class FiroWallet extends CoinServiceAPI {
required CachedElectrumX cachedClient,
required TransactionNotificationTracker tracker,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) {
txTracker = tracker;
_walletId = walletId;

View file

@ -1358,7 +1358,7 @@ class LitecoinWallet extends CoinServiceAPI {
CachedElectrumX get cachedElectrumXClient => _cachedElectrumXClient;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -1370,7 +1370,7 @@ class LitecoinWallet extends CoinServiceAPI {
required CachedElectrumX cachedClient,
required TransactionNotificationTracker tracker,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) {
txTracker = tracker;
_walletId = walletId;

View file

@ -67,7 +67,7 @@ class MoneroWallet extends CoinServiceAPI {
Timer? moneroAutosaveTimer;
late Coin _coin;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -82,7 +82,7 @@ class MoneroWallet extends CoinServiceAPI {
required String walletName,
required Coin coin,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore}) {
required SecureStorageInterface secureStore}) {
_walletId = walletId;
_walletName = walletName;
_coin = coin;

View file

@ -1349,7 +1349,7 @@ class NamecoinWallet extends CoinServiceAPI {
CachedElectrumX get cachedElectrumXClient => _cachedElectrumXClient;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -1361,7 +1361,7 @@ class NamecoinWallet extends CoinServiceAPI {
required CachedElectrumX cachedClient,
required TransactionNotificationTracker tracker,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) {
txTracker = tracker;
_walletId = walletId;

View file

@ -68,7 +68,7 @@ class WowneroWallet extends CoinServiceAPI {
Timer? wowneroAutosaveTimer;
late Coin _coin;
late FlutterSecureStorageInterface _secureStore;
late SecureStorageInterface _secureStore;
late PriceAPI _priceAPI;
@ -83,7 +83,7 @@ class WowneroWallet extends CoinServiceAPI {
required String walletName,
required Coin coin,
PriceAPI? priceAPI,
required FlutterSecureStorageInterface secureStore}) {
required SecureStorageInterface secureStore}) {
_walletId = walletId;
_walletName = walletName;
_coin = coin;

View file

@ -12,7 +12,7 @@ import 'package:stackwallet/utilities/logger.dart';
const kStackCommunityNodesEndpoint = "https://extras.stackwallet.com";
class NodeService extends ChangeNotifier {
final FlutterSecureStorageInterface secureStorageInterface;
final SecureStorageInterface secureStorageInterface;
/// Exposed [secureStorageInterface] in order to inject mock for tests
NodeService({

View file

@ -47,14 +47,14 @@ class WalletInfo {
}
class WalletsService extends ChangeNotifier {
late final FlutterSecureStorageInterface _secureStore;
late final SecureStorageInterface _secureStore;
Future<Map<String, WalletInfo>>? _walletNames;
Future<Map<String, WalletInfo>> get walletNames =>
_walletNames ??= _fetchWalletNames();
WalletsService({
required FlutterSecureStorageInterface secureStorageInterface,
required SecureStorageInterface secureStorageInterface,
}) {
_secureStore = secureStorageInterface;
}

View file

@ -16,7 +16,7 @@ import 'package:stackwallet/utilities/prefs.dart';
class DbVersionMigrator {
Future<void> migrate(
int fromVersion, {
required FlutterSecureStorageInterface secureStore,
required SecureStorageInterface secureStore,
}) async {
Logging.instance.log(
"Running migrate fromVersion $fromVersion",

View file

@ -84,7 +84,7 @@ class DPS {
"${_getMessageFromException(e)}\n$s",
level: LogLevel.Error,
);
rethrow;
throw Exception(_getMessageFromException(e));
}
}

View file

@ -1,8 +1,11 @@
import 'dart:io';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:isar/isar.dart';
import 'package:stack_wallet_backup/secure_storage.dart';
import 'package:stackwallet/models/isar/models/encrypted_string_value.dart';
abstract class FlutterSecureStorageInterface {
abstract class SecureStorageInterface {
Future<void> write({
required String key,
required String? value,
@ -35,38 +38,66 @@ abstract class FlutterSecureStorageInterface {
});
}
class DesktopPWStore {
class DesktopSecureStore {
final StorageCryptoHandler handler;
late final Isar isar;
DesktopPWStore(this.handler);
DesktopSecureStore(this.handler);
Future<void> init() async {}
Future<void> init() async {
Directory? appDirectory;
if (Platform.isLinux) {
appDirectory = Directory("${Platform.environment['HOME']}/.stackwallet");
await appDirectory.create();
}
isar = await Isar.open(
[EncryptedStringValueSchema],
directory: appDirectory!.path,
inspector: false,
);
}
Future<String?> read({
required String key,
}) async {
// final String encryptedString =
final value =
await isar.encryptedStringValues.filter().keyEqualTo(key).findFirst();
return "";
// value does not exist;
if (value == null) {
return null;
}
return await handler.decryptValue(key, value.value);
}
Future<void> write({
required String key,
required String? value,
}) async {
return;
if (value == null) {
// here we assume that a value is to be deleted
await isar.encryptedStringValues.deleteByKey(key);
} else {
// otherwise created encrypted object value
final object = EncryptedStringValue();
object.key = key;
object.value = await handler.encryptValue(key, value);
// store object value
await isar.encryptedStringValues.put(object);
}
}
Future<void> delete({
required String key,
}) async {
return;
await isar.encryptedStringValues.deleteByKey(key);
}
}
/// all *Options params ignored on desktop
class SecureStorageWrapper implements FlutterSecureStorageInterface {
class SecureStorageWrapper implements SecureStorageInterface {
final dynamic _store;
final bool _isDesktop;
@ -74,7 +105,7 @@ class SecureStorageWrapper implements FlutterSecureStorageInterface {
required dynamic store,
required bool isDesktop,
}) : assert(isDesktop
? store is DesktopPWStore
? store is DesktopSecureStore
: store is FlutterSecureStorage),
_store = store,
_isDesktop = isDesktop;
@ -90,7 +121,7 @@ class SecureStorageWrapper implements FlutterSecureStorageInterface {
WindowsOptions? wOptions,
}) async {
if (_isDesktop) {
return await (_store as DesktopPWStore).read(key: key);
return await (_store as DesktopSecureStore).read(key: key);
} else {
return await (_store as FlutterSecureStorage).read(
key: key,
@ -116,7 +147,7 @@ class SecureStorageWrapper implements FlutterSecureStorageInterface {
WindowsOptions? wOptions,
}) async {
if (_isDesktop) {
return await (_store as DesktopPWStore).write(key: key, value: value);
return await (_store as DesktopSecureStore).write(key: key, value: value);
} else {
return await (_store as FlutterSecureStorage).write(
key: key,
@ -142,7 +173,7 @@ class SecureStorageWrapper implements FlutterSecureStorageInterface {
WindowsOptions? wOptions,
}) async {
if (_isDesktop) {
return (_store as DesktopPWStore).delete(key: key);
return (_store as DesktopSecureStore).delete(key: key);
} else {
return await (_store as FlutterSecureStorage).delete(
key: key,
@ -158,7 +189,7 @@ class SecureStorageWrapper implements FlutterSecureStorageInterface {
}
// Mock class for testing purposes
class FakeSecureStorage implements FlutterSecureStorageInterface {
class FakeSecureStorage implements SecureStorageInterface {
final Map<String, String?> _store = {};
int _interactions = 0;
int get interactions => _interactions;

View file

@ -678,6 +678,14 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
@override
_i4.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
Invocation.method(
#isExternalCallsSet,
[],
),
returnValue: _i4.Future<bool>.value(false),
) as _i4.Future<bool>);
@override
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,

View file

@ -399,6 +399,14 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
@override
_i3.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
Invocation.method(
#isExternalCallsSet,
[],
),
returnValue: _i3.Future<bool>.value(false),
) as _i3.Future<bool>);
@override
void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,

View file

@ -1,5 +1,5 @@
// Mocks generated by Mockito 5.3.2 from annotations
// in stackwallet/test/pages/send_view_test.dart.
// in stackwallet/test/pages/send_view/send_view_test.dart.
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
@ -86,7 +86,7 @@ class _FakeManager_3 extends _i1.SmartFake implements _i6.Manager {
}
class _FakeFlutterSecureStorageInterface_4 extends _i1.SmartFake
implements _i7.FlutterSecureStorageInterface {
implements _i7.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_4(
Object parent,
Invocation parentInvocation,
@ -621,14 +621,13 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
}
@override
_i7.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i7.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_4(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i7.FlutterSecureStorageInterface);
) as _i7.SecureStorageInterface);
@override
List<_i19.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),
@ -890,6 +889,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i9.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
bool get isActive => (super.noSuchMethod(
Invocation.getter(#isActive),
returnValue: false,
@ -1272,6 +1279,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet {
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
bool validateAddress(String? address) => (super.noSuchMethod(
Invocation.method(
#validateAddress,
@ -1875,6 +1892,14 @@ class MockPrefs extends _i1.Mock implements _i17.Prefs {
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
_i16.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
Invocation.method(
#isExternalCallsSet,
[],
),
returnValue: _i16.Future<bool>.value(false),
) as _i16.Future<bool>);
@override
void addListener(_i18.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
@ -2623,4 +2648,14 @@ class MockCoinServiceAPI extends _i1.Mock implements _i13.CoinServiceAPI {
),
returnValue: _i16.Future<bool>.value(false),
) as _i16.Future<bool>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
}

View file

@ -350,6 +350,14 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
returnValueForMissingStub: _i7.Future<void>.value(),
) as _i7.Future<void>);
@override
_i7.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
Invocation.method(
#isExternalCallsSet,
[],
),
returnValue: _i7.Future<bool>.value(false),
) as _i7.Future<bool>);
@override
void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,

View file

@ -30,7 +30,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
// ignore_for_file: subtype_of_sealed_class
class _FakeFlutterSecureStorageInterface_0 extends _i1.SmartFake
implements _i2.FlutterSecureStorageInterface {
implements _i2.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_0(
Object parent,
Invocation parentInvocation,
@ -309,14 +309,13 @@ class MockWalletsService extends _i1.Mock implements _i6.WalletsService {
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i10.NodeService {
@override
_i2.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_0(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i2.FlutterSecureStorageInterface);
) as _i2.SecureStorageInterface);
@override
List<_i11.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -30,7 +30,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
// ignore_for_file: subtype_of_sealed_class
class _FakeFlutterSecureStorageInterface_0 extends _i1.SmartFake
implements _i2.FlutterSecureStorageInterface {
implements _i2.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_0(
Object parent,
Invocation parentInvocation,
@ -309,14 +309,13 @@ class MockWalletsService extends _i1.Mock implements _i6.WalletsService {
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i10.NodeService {
@override
_i2.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_0(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i2.FlutterSecureStorageInterface);
) as _i2.SecureStorageInterface);
@override
List<_i11.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -84,7 +84,7 @@ class _FakeTransactionData_4 extends _i1.SmartFake
}
class _FakeFlutterSecureStorageInterface_5 extends _i1.SmartFake
implements _i6.FlutterSecureStorageInterface {
implements _i6.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_5(
Object parent,
Invocation parentInvocation,
@ -744,14 +744,14 @@ class MockManager extends _i1.Mock implements _i12.Manager {
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i13.NodeService {
@override
_i6.FlutterSecureStorageInterface get secureStorageInterface =>
_i6.SecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_5(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i6.FlutterSecureStorageInterface);
) as _i6.SecureStorageInterface);
@override
List<_i14.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -29,7 +29,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
// ignore_for_file: subtype_of_sealed_class
class _FakeFlutterSecureStorageInterface_0 extends _i1.SmartFake
implements _i2.FlutterSecureStorageInterface {
implements _i2.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_0(
Object parent,
Invocation parentInvocation,
@ -86,14 +86,13 @@ class _FakeTransactionData_4 extends _i1.SmartFake
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i6.NodeService {
@override
_i2.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_0(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i2.FlutterSecureStorageInterface);
) as _i2.SecureStorageInterface);
@override
List<_i7.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -29,7 +29,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
// ignore_for_file: subtype_of_sealed_class
class _FakeFlutterSecureStorageInterface_0 extends _i1.SmartFake
implements _i2.FlutterSecureStorageInterface {
implements _i2.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_0(
Object parent,
Invocation parentInvocation,
@ -86,14 +86,13 @@ class _FakeTransactionData_4 extends _i1.SmartFake
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i6.NodeService {
@override
_i2.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_0(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i2.FlutterSecureStorageInterface);
) as _i2.SecureStorageInterface);
@override
List<_i7.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -25,7 +25,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
// ignore_for_file: subtype_of_sealed_class
class _FakeFlutterSecureStorageInterface_0 extends _i1.SmartFake
implements _i2.FlutterSecureStorageInterface {
implements _i2.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_0(
Object parent,
Invocation parentInvocation,
@ -40,14 +40,13 @@ class _FakeFlutterSecureStorageInterface_0 extends _i1.SmartFake
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i3.NodeService {
@override
_i2.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_0(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i2.FlutterSecureStorageInterface);
) as _i2.SecureStorageInterface);
@override
List<_i4.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -139,6 +139,22 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX {
_i8.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i8.Future<Map<String, dynamic>>);
@override
String base64ToHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToHex,
[source],
),
returnValue: '',
) as String);
@override
String base64ToReverseHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToReverseHex,
[source],
),
returnValue: '',
) as String);
@override
_i8.Future<Map<String, dynamic>> getTransaction({
required String? txHash,
required _i9.Coin? coin,

View file

@ -465,6 +465,22 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX {
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
String base64ToHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToHex,
[source],
),
returnValue: '',
) as String);
@override
String base64ToReverseHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToReverseHex,
[source],
),
returnValue: '',
) as String);
@override
_i6.Future<Map<String, dynamic>> getTransaction({
required String? txHash,
required _i8.Coin? coin,

View file

@ -465,6 +465,22 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX {
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
String base64ToHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToHex,
[source],
),
returnValue: '',
) as String);
@override
String base64ToReverseHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToReverseHex,
[source],
),
returnValue: '',
) as String);
@override
_i6.Future<Map<String, dynamic>> getTransaction({
required String? txHash,
required _i8.Coin? coin,

View file

@ -465,6 +465,22 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX {
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
String base64ToHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToHex,
[source],
),
returnValue: '',
) as String);
@override
String base64ToReverseHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToReverseHex,
[source],
),
returnValue: '',
) as String);
@override
_i6.Future<Map<String, dynamic>> getTransaction({
required String? txHash,
required _i8.Coin? coin,

View file

@ -465,6 +465,22 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX {
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
String base64ToHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToHex,
[source],
),
returnValue: '',
) as String);
@override
String base64ToReverseHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToReverseHex,
[source],
),
returnValue: '',
) as String);
@override
_i6.Future<Map<String, dynamic>> getTransaction({
required String? txHash,
required _i8.Coin? coin,

View file

@ -117,6 +117,14 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i4.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
_i2.TransactionNotificationTracker get txTracker => (super.noSuchMethod(
Invocation.getter(#txTracker),
returnValue: _FakeTransactionNotificationTracker_0(
@ -375,6 +383,16 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
returnValue: false,
) as bool);
@override
_i8.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i8.Future<void>.value(),
returnValueForMissingStub: _i8.Future<void>.value(),
) as _i8.Future<void>);
@override
_i8.Future<bool> testNetworkConnection() => (super.noSuchMethod(
Invocation.method(
#testNetworkConnection,

View file

@ -465,6 +465,22 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX {
_i6.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i6.Future<Map<String, dynamic>>);
@override
String base64ToHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToHex,
[source],
),
returnValue: '',
) as String);
@override
String base64ToReverseHex(String? source) => (super.noSuchMethod(
Invocation.method(
#base64ToReverseHex,
[source],
),
returnValue: '',
) as String);
@override
_i6.Future<Map<String, dynamic>> getTransaction({
required String? txHash,
required _i8.Coin? coin,

View file

@ -3,12 +3,12 @@
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;
import 'dart:async' as _i3;
import 'package:flutter_secure_storage/flutter_secure_storage.dart' as _i2;
import 'package:flutter_secure_storage/flutter_secure_storage.dart' as _i4;
import 'package:mockito/mockito.dart' as _i1;
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
as _i3;
as _i2;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
@ -21,43 +21,24 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class
class _FakeFlutterSecureStorage_0 extends _i1.SmartFake
implements _i2.FlutterSecureStorage {
_FakeFlutterSecureStorage_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}
/// A class which mocks [SecureStorageWrapper].
///
/// See the documentation for Mockito's code generation for more information.
class MockSecureStorageWrapper extends _i1.Mock
implements _i3.SecureStorageWrapper {
implements _i2.SecureStorageWrapper {
MockSecureStorageWrapper() {
_i1.throwOnMissingStub(this);
}
@override
_i2.FlutterSecureStorage get _secureStore => (super.noSuchMethod(
Invocation.getter(#secureStore),
returnValue: _FakeFlutterSecureStorage_0(
this,
Invocation.getter(#secureStore),
),
) as _i2.FlutterSecureStorage);
@override
_i4.Future<String?> read({
_i3.Future<String?> read({
required String? key,
_i2.IOSOptions? iOptions,
_i2.AndroidOptions? aOptions,
_i2.LinuxOptions? lOptions,
_i2.WebOptions? webOptions,
_i2.MacOsOptions? mOptions,
_i2.WindowsOptions? wOptions,
_i4.IOSOptions? iOptions,
_i4.AndroidOptions? aOptions,
_i4.LinuxOptions? lOptions,
_i4.WebOptions? webOptions,
_i4.MacOsOptions? mOptions,
_i4.WindowsOptions? wOptions,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -73,18 +54,18 @@ class MockSecureStorageWrapper extends _i1.Mock
#wOptions: wOptions,
},
),
returnValue: _i4.Future<String?>.value(),
) as _i4.Future<String?>);
returnValue: _i3.Future<String?>.value(),
) as _i3.Future<String?>);
@override
_i4.Future<void> write({
_i3.Future<void> write({
required String? key,
required String? value,
_i2.IOSOptions? iOptions,
_i2.AndroidOptions? aOptions,
_i2.LinuxOptions? lOptions,
_i2.WebOptions? webOptions,
_i2.MacOsOptions? mOptions,
_i2.WindowsOptions? wOptions,
_i4.IOSOptions? iOptions,
_i4.AndroidOptions? aOptions,
_i4.LinuxOptions? lOptions,
_i4.WebOptions? webOptions,
_i4.MacOsOptions? mOptions,
_i4.WindowsOptions? wOptions,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -101,18 +82,18 @@ class MockSecureStorageWrapper extends _i1.Mock
#wOptions: wOptions,
},
),
returnValue: _i4.Future<void>.value(),
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
@override
_i4.Future<void> delete({
_i3.Future<void> delete({
required String? key,
_i2.IOSOptions? iOptions,
_i2.AndroidOptions? aOptions,
_i2.LinuxOptions? lOptions,
_i2.WebOptions? webOptions,
_i2.MacOsOptions? mOptions,
_i2.WindowsOptions? wOptions,
_i4.IOSOptions? iOptions,
_i4.AndroidOptions? aOptions,
_i4.LinuxOptions? lOptions,
_i4.WebOptions? webOptions,
_i4.MacOsOptions? mOptions,
_i4.WindowsOptions? wOptions,
}) =>
(super.noSuchMethod(
Invocation.method(
@ -128,7 +109,7 @@ class MockSecureStorageWrapper extends _i1.Mock
#wOptions: wOptions,
},
),
returnValue: _i4.Future<void>.value(),
returnValueForMissingStub: _i4.Future<void>.value(),
) as _i4.Future<void>);
returnValue: _i3.Future<void>.value(),
returnValueForMissingStub: _i3.Future<void>.value(),
) as _i3.Future<void>);
}

View file

@ -166,7 +166,7 @@ class _FakeElectrumXNode_11 extends _i1.SmartFake
}
class _FakeFlutterSecureStorageInterface_12 extends _i1.SmartFake
implements _i12.FlutterSecureStorageInterface {
implements _i12.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_12(
Object parent,
Invocation parentInvocation,
@ -681,6 +681,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i8.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
bool get isActive => (super.noSuchMethod(
Invocation.getter(#isActive),
returnValue: false,
@ -1063,6 +1071,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
bool validateAddress(String? address) => (super.noSuchMethod(
Invocation.method(
#validateAddress,
@ -1380,14 +1398,13 @@ class MockLocaleService extends _i1.Mock implements _i20.LocaleService {
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i3.NodeService {
@override
_i12.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i12.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_12(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i12.FlutterSecureStorageInterface);
) as _i12.SecureStorageInterface);
@override
List<_i21.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),
@ -2291,4 +2308,14 @@ class MockCoinServiceAPI extends _i1.Mock implements _i13.CoinServiceAPI {
),
returnValue: _i16.Future<bool>.value(false),
) as _i16.Future<bool>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
}

View file

@ -25,7 +25,7 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
// ignore_for_file: subtype_of_sealed_class
class _FakeFlutterSecureStorageInterface_0 extends _i1.SmartFake
implements _i2.FlutterSecureStorageInterface {
implements _i2.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_0(
Object parent,
Invocation parentInvocation,
@ -44,14 +44,13 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
}
@override
_i2.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_0(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i2.FlutterSecureStorageInterface);
) as _i2.SecureStorageInterface);
@override
List<_i4.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -77,7 +77,7 @@ class _FakeManager_3 extends _i1.SmartFake implements _i6.Manager {
}
class _FakeFlutterSecureStorageInterface_4 extends _i1.SmartFake
implements _i7.FlutterSecureStorageInterface {
implements _i7.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_4(
Object parent,
Invocation parentInvocation,
@ -573,6 +573,14 @@ class MockPrefs extends _i1.Mock implements _i11.Prefs {
returnValueForMissingStub: _i10.Future<void>.value(),
) as _i10.Future<void>);
@override
_i10.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
Invocation.method(
#isExternalCallsSet,
[],
),
returnValue: _i10.Future<bool>.value(false),
) as _i10.Future<bool>);
@override
void addListener(_i12.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
@ -615,14 +623,14 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
}
@override
_i7.FlutterSecureStorageInterface get secureStorageInterface =>
_i7.SecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_4(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i7.FlutterSecureStorageInterface);
) as _i7.SecureStorageInterface);
@override
List<_i16.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),

View file

@ -666,6 +666,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i18.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i8.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
bool get isActive => (super.noSuchMethod(
Invocation.getter(#isActive),
returnValue: false,
@ -1048,6 +1056,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i18.BitcoinWallet {
returnValueForMissingStub: _i15.Future<void>.value(),
) as _i15.Future<void>);
@override
_i15.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i15.Future<void>.value(),
returnValueForMissingStub: _i15.Future<void>.value(),
) as _i15.Future<void>);
@override
bool validateAddress(String? address) => (super.noSuchMethod(
Invocation.method(
#validateAddress,
@ -2013,4 +2031,14 @@ class MockCoinServiceAPI extends _i1.Mock implements _i12.CoinServiceAPI {
),
returnValue: _i15.Future<bool>.value(false),
) as _i15.Future<bool>);
@override
_i15.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i15.Future<void>.value(),
returnValueForMissingStub: _i15.Future<void>.value(),
) as _i15.Future<void>);
}

View file

@ -1108,6 +1108,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI {
),
returnValue: _i16.Future<bool>.value(false),
) as _i16.Future<bool>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
}
/// A class which mocks [FiroWallet].
@ -1127,6 +1137,14 @@ class MockFiroWallet extends _i1.Mock implements _i19.FiroWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i8.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
_i10.TransactionNotificationTracker get txTracker => (super.noSuchMethod(
Invocation.getter(#txTracker),
returnValue: _FakeTransactionNotificationTracker_8(
@ -1386,6 +1404,16 @@ class MockFiroWallet extends _i1.Mock implements _i19.FiroWallet {
returnValue: false,
) as bool);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
_i16.Future<bool> testNetworkConnection() => (super.noSuchMethod(
Invocation.method(
#testNetworkConnection,
@ -2312,6 +2340,14 @@ class MockPrefs extends _i1.Mock implements _i17.Prefs {
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
_i16.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
Invocation.method(
#isExternalCallsSet,
[],
),
returnValue: _i16.Future<bool>.value(false),
) as _i16.Future<bool>);
@override
void addListener(_i18.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,

View file

@ -429,6 +429,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i17.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i8.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
bool get isActive => (super.noSuchMethod(
Invocation.getter(#isActive),
returnValue: false,
@ -811,6 +819,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i17.BitcoinWallet {
returnValueForMissingStub: _i14.Future<void>.value(),
) as _i14.Future<void>);
@override
_i14.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i14.Future<void>.value(),
returnValueForMissingStub: _i14.Future<void>.value(),
) as _i14.Future<void>);
@override
bool validateAddress(String? address) => (super.noSuchMethod(
Invocation.method(
#validateAddress,

View file

@ -165,7 +165,7 @@ class _FakeElectrumXNode_11 extends _i1.SmartFake
}
class _FakeFlutterSecureStorageInterface_12 extends _i1.SmartFake
implements _i12.FlutterSecureStorageInterface {
implements _i12.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_12(
Object parent,
Invocation parentInvocation,
@ -680,6 +680,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i8.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
bool get isActive => (super.noSuchMethod(
Invocation.getter(#isActive),
returnValue: false,
@ -1062,6 +1070,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
bool validateAddress(String? address) => (super.noSuchMethod(
Invocation.method(
#validateAddress,
@ -1317,14 +1335,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i3.NodeService {
@override
_i12.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i12.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_12(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i12.FlutterSecureStorageInterface);
) as _i12.SecureStorageInterface);
@override
List<_i20.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),
@ -2228,4 +2245,14 @@ class MockCoinServiceAPI extends _i1.Mock implements _i13.CoinServiceAPI {
),
returnValue: _i16.Future<bool>.value(false),
) as _i16.Future<bool>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
}

View file

@ -165,7 +165,7 @@ class _FakeElectrumXNode_11 extends _i1.SmartFake
}
class _FakeFlutterSecureStorageInterface_12 extends _i1.SmartFake
implements _i12.FlutterSecureStorageInterface {
implements _i12.SecureStorageInterface {
_FakeFlutterSecureStorageInterface_12(
Object parent,
Invocation parentInvocation,
@ -680,6 +680,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
returnValueForMissingStub: null,
);
@override
set cachedTxData(_i8.TransactionData? _cachedTxData) => super.noSuchMethod(
Invocation.setter(
#cachedTxData,
_cachedTxData,
),
returnValueForMissingStub: null,
);
@override
bool get isActive => (super.noSuchMethod(
Invocation.getter(#isActive),
returnValue: false,
@ -1062,6 +1070,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
@override
bool validateAddress(String? address) => (super.noSuchMethod(
Invocation.method(
#validateAddress,
@ -1317,14 +1335,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet {
/// See the documentation for Mockito's code generation for more information.
class MockNodeService extends _i1.Mock implements _i3.NodeService {
@override
_i12.FlutterSecureStorageInterface get secureStorageInterface =>
(super.noSuchMethod(
_i12.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod(
Invocation.getter(#secureStorageInterface),
returnValue: _FakeFlutterSecureStorageInterface_12(
this,
Invocation.getter(#secureStorageInterface),
),
) as _i12.FlutterSecureStorageInterface);
) as _i12.SecureStorageInterface);
@override
List<_i20.NodeModel> get primaryNodes => (super.noSuchMethod(
Invocation.getter(#primaryNodes),
@ -2228,4 +2245,14 @@ class MockCoinServiceAPI extends _i1.Mock implements _i13.CoinServiceAPI {
),
returnValue: _i16.Future<bool>.value(false),
) as _i16.Future<bool>);
@override
_i16.Future<void> updateSentCachedTxData(Map<String, dynamic>? txData) =>
(super.noSuchMethod(
Invocation.method(
#updateSentCachedTxData,
[txData],
),
returnValue: _i16.Future<void>.value(),
returnValueForMissingStub: _i16.Future<void>.value(),
) as _i16.Future<void>);
}