-
Notifications
You must be signed in to change notification settings - Fork 370
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
Added Export JSON Keystore screens #3498
Added Export JSON Keystore screens #3498
Conversation
eb7a5ac
to
ff0462a
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.
There's a glitch when the 2 new view controllers appear, maybe the background color isn't set? (still .clear
?)
Simulator.Screen.Recording.-.iPhone.11.-.2021-12-03.at.12.31.29.mp4
Remember to remove the spurious comments in the git commit message after squashing
AlphaWallet/Settings/Coordinators/ExportJsonKeystoreCoordinator.swift
Outdated
Show resolved
Hide resolved
AlphaWallet/Settings/Coordinators/ExportJsonKeystoreCoordinator.swift
Outdated
Show resolved
Hide resolved
AlphaWallet/Settings/Coordinators/ExportJsonKeystoreCoordinator.swift
Outdated
Show resolved
Hide resolved
@@ -97,6 +97,15 @@ | |||
"settings.language.useSystem.title" = "Use System Setting"; | |||
"settings.version.label.title" = "Version"; | |||
"settings.tokenScriptStandard.title" = "TokenScript Compatibility"; | |||
"settings.advanced.exportJSONKeystore.title" = "Export JSON Keystore"; | |||
"settings.advanced.exportJSONKeystore.info.title" = "Export JSON Keystore"; | |||
"settings.advanced.exportJSONKeystore.info.label" = "Your Keystore JSON"; |
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 should be "Set password".
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.
Can you be more specific? Or do you mean
"settings.advanced.exportJSONKeystore.password.title" = "Set Password for JSON Keystore";
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.
The button's title which is set to: "settings.advanced.exportJSONKeystore.info.label". That button's title should be "Set password" instead.
AlphaWallet/Settings/Coordinators/ExportJsonKeystoreCoordinator.swift
Outdated
Show resolved
Hide resolved
AlphaWallet/Settings/ViewControllers/ExportJsonKeystorePasswordViewController.swift
Show resolved
Hide resolved
@eviltofu after the changes, do you want to work on those 2 TODOs too? So we support 2 types of wallets: A. Private key We don't allow users to generate A anymore, but allow them to import them. Users can import both types of wallets. The Keystore/JSON file is generated from A. Look for this to see how to export it from (A):
The lines following it also shows how to export it with the sharing sheet. For B: To export the Keystore/JSON file from B, we'll have to go from B to A first. But I'll work on this later when you are done. The keystore part is a bit more sensitive and it doesn't support this operation yet. You can check with something like this:
You can verify if it works by importing the JSON file along with the password as a wallet. It should tell you the wallet has already been imported (or exist). It is also important to check that this is not a watched wallet (no key, no seed phrase) with |
ff0462a
to
83565a8
Compare
Simulator.Screen.Recording.-.iPhone.13.-.2021-12-03.at.21.09.18.mp4 |
@eviltofu this isn't blocked by me, right? |
This is not blocked by you. It's being blocked by the M1 MacBook Air. Once I finish creating the second issue where I report what fails I'll revert back to this. |
Can you not mix in changes related to Dark mode into this PR? Also, I'd rather we not work on Dark mode yet. |
@hboon The colours are set up with Dark and Light mode in the semantic way we discussed. We have the colours defined in the .xcassets file. Then a struct with static constants that returns the colour based on the user style (dark or light mode). Was I not suppose to build this? |
Ah, right. You'd wanted to experiment how to build an abstraction for the UI building. The number of modified files had me worried for a minute. Would it be feasible to do this — build this PR without that with 1 commit; it seems like it is almost done. Then follow up with another PR to introduce changes you think is necessary for that abstraction and to support Dark Mode etc? Then it's easier to explore, tweak that second PR, drop it, or expand the approach if it's good? |
8b57373
to
ba216aa
Compare
@hboon It's completed right now. Do you still want me to remove the UIFactory code? It's pretty straightforward. |
ba216aa
to
0173716
Compare
@hboon removed UIFactory except for the color xcasset. |
@eviltofu can you help to exclude the UIFactory files too? Seems to be excluded from the project, but they are still in the PR. |
0173716
to
1ce70c6
Compare
@hboon removed requested files, merged the current upstream/master, and force pushed. You can ignore the changes for the .xcasset files. I originally moved all the colours to a separate .xcasset file for UIKitFactory and then moved them back when I removed the UIKitFactory files. |
AlphaWallet/Settings/ViewControllers/ExportJsonKeystorePasswordViewController.swift
Outdated
Show resolved
Hide resolved
AlphaWallet/Settings/ViewModels/ExportJsonKeystorePasswordViewModel.swift
Outdated
Show resolved
Hide resolved
AlphaWallet/Settings/ViewModels/ExportJsonKeystorePasswordViewModel.swift
Outdated
Show resolved
Hide resolved
AlphaWallet/Settings/ViewControllers/AdvancedSettingsViewController.swift
Outdated
Show resolved
Hide resolved
AlphaWallet/Settings/ViewControllers/ExportJsonKeystorePasswordViewController.swift
Outdated
Show resolved
Hide resolved
79f4fe9
to
ae4315e
Compare
@hboon updated Features. |
@eviltofu do you mean this is good for review + merge? |
Yes |
ae4315e
to
48a5db8
Compare
Part of: #2719
Testing
Preparation
Test Password screen
Test Enable/Disable "Export JSON Keystore" button
Test character filter (right now only alphanumerics are accepted)
Test show/hide password
Test Info screen
Test back button
Test complete export
Start Mode
In the
ExportJsonKeystoreCoordinator
class, you can specify which screen to start first via thestart
function.Validation rules
The validation rules are a list of rules which can specify the validity of the password. The rules are:
Rules 1-4 expect an integer. The code does not check for logic. Rules 5-6 expect
CharacterSet
data.Test show export page
If a Watched Wallet
Preparation
You will need an Etherium wallet address. You can get one from Etherscan. The one I choose was
0xCD458d7F11023556cC9058F729831a038Cb8Df9c
.If a Real Wallet