@@ -88,24 +88,23 @@ class Bip85Datasource {
8888 }
8989
9090 Future <Bip85DerivationModel ?> fetch (String path) async {
91- final row =
92- await _sqlite.managers.bip85Derivations
93- .filter ((b) => b.path (path))
94- .getSingleOrNull ();
91+ final row = await _sqlite.managers.bip85Derivations
92+ .filter ((b) => b.path (path))
93+ .getSingleOrNull ();
9594
9695 return row != null ? Bip85DerivationModel .fromSqlite (row) : null ;
9796 }
9897
9998 Future <int > fetchNextIndexForApplication (
10099 Bip85ApplicationColumn application,
101100 ) async {
102- final rows =
103- await _sqlite.managers.bip85Derivations
104- .filter ((b) => b.application (application))
105- .get ();
101+ final rows = await _sqlite.managers.bip85Derivations
102+ .filter ((b) => b.application (application))
103+ .get ();
106104
107- final models =
108- rows.map ((row) => Bip85DerivationModel .fromSqlite (row)).toList ();
105+ final models = rows
106+ .map ((row) => Bip85DerivationModel .fromSqlite (row))
107+ .toList ();
109108
110109 int nextIndex = 0 ;
111110 for (final model in models) {
@@ -134,7 +133,7 @@ class Bip85Datasource {
134133 }
135134 }
136135
137- Future <void > reactivate (String path) async {
136+ Future <void > activate (String path) async {
138137 try {
139138 await _sqlite.managers.bip85Derivations
140139 .filter ((b) => b.path (path))
@@ -144,6 +143,16 @@ class Bip85Datasource {
144143 }
145144 }
146145
146+ Future <void > alias (String path, String alias) async {
147+ try {
148+ await _sqlite.managers.bip85Derivations
149+ .filter ((b) => b.path (path))
150+ .update ((b) => b (alias: Value (alias)));
151+ } catch (e) {
152+ rethrow ;
153+ }
154+ }
155+
147156 // We should not use _store without properly formatting the derivation path.
148157 Future <void > _store (Bip85DerivationModel bip85) async {
149158 try {
0 commit comments