-
Notifications
You must be signed in to change notification settings - Fork 17
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
Refactor code fore blockchain network management #1691
Conversation
… referring to the relaychains
72f11da
to
cc639f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was unused, we kept it as a reference, as it fetches data from subscan. By now I guess, we can be certain that we won't use subscan anymore.
return !endpointIsTeeProxy; | ||
} | ||
|
||
@computed | ||
bool get endpointIsTeeProxy { | ||
return endpoint.worker != null; | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the unused endPointIsTeeProxy
and default to true
for endPointIsNoTee
Future<String?> getKV(String cacheKey) { | ||
return Future.value(); | ||
return Future.value(storage[cacheKey] as String?); | ||
} | ||
|
||
@override | ||
Future<void> setKV(String cacheKey, String value) { | ||
storage[cacheKey] = value; | ||
return Future.value(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to properly overwrite some new LocalStorage
methods because we use method in the real thing now.
String id() { | ||
return switch (this) { | ||
encointerKusama => kusamaId, | ||
encointerRococo => rococoId, | ||
gesell => gesellId, | ||
gesellDev => gesellDevId, | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this was stored at the endpoint.info
, but I think that ID fits better.
Future<bool> removeObject(String key) { | ||
return storage.removeKey('${customKVKey}_$key'); | ||
} | ||
|
||
Future<bool> removeKV(String key) { | ||
return storage.removeKey(key); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a weird ambiguity before. We should have a look at the local storage implementation at some point: #1692
@@ -15,7 +15,7 @@ class AccountSelectList extends StatelessWidget { | |||
Widget build(BuildContext context) { | |||
return ListView( | |||
children: accounts.map((account) { | |||
final address = AddressUtils.pubKeyHexToAddress(account.pubKey, prefix: store.settings.endpoint.ss58!); | |||
final address = AddressUtils.pubKeyHexToAddress(account.pubKey, prefix: store.settings.currentNetwork.ss58()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think endpoint
was a misnomer
since ever. I changed it to currentNetwork
.
I did this as a preparation for task for #1603 in order to simplify management of multiple endpoints per network.
Changes
!
/?
operators in the code base.Testing: