These tests must be done in an Electron application. Some features might work on the web browser but show different behavior when using electron.
You can connect your wallet to the testnet (https://node1.foxtrot.testnet.hathor.network/v1a/) to run the tests.
-
Wallet update
- [Using the old version of the wallet!] If your wallet is not initialized, initialize it.
- Close the wallet.
- Install the new version of Hathor Wallet.
- Open Hathor Wallet. It should be on lock screen.
- Unlock it and check that you transactions were loaded with correct balance (it's ok if there are no transactions).
- You may now reset your wallet.
-
Initialization (you must be on Welcome screen)
- Close and open your wallet. You must still be on the Welcome screen.
- Try to click 'Get started' without selecting checkbox (must show error).
- Select the checkbox and click 'Get started'
- Choose Software Wallet.
- Start new wallet.
- Try to click 'Create my words' without selecting checkbox (must show error).
- Close and open your wallet. You must see the screen to select 'Hardware wallet' or 'Software wallet'. Select 'Software wallet' then 'new wallet' and then 'create my words'.
- Select to do backup now. (Really save those words, we will load this wallet later with them).
- Correctly select the first word but select a wrong one in the second. Check that it returns to the seed screen to restart the validation.
- Validate all the words correctly.
- Try to select insecure password (like '123'). It must show error.
- Select password and PIN.
-
New token error
- Click on 'Custom tokens', then 'Create a new token'.
- Type 'Test token' in the token name, 'Test' in the symbol and 100 in the amount.
- Validates that the deposit required is 1.00 HTR.
- Try to create the token and receive an error that you don't have enough HTR.
-
Wallet screen
- Copy the address and send 10.00 HTR from another wallet to this address.
- Check that the transaction appears in the list, the balance was updated and the address also changed.
- Click on 'See all addresses' and see the list. The address used to send the transaction should have 'Number of transactions' equal to 1.
- Copy this address and paste to search, validate it appears only one line on the table with the searched address.
- Click on 'Generate new address' and validate it has changed.
- Click on the 'QR Code', and copy the address to validate it really copied.
- Read the QRCode and validate it's the same as the written text.
- Download the QRCode and execute the same validation.
- Send another transaction to your address but with timelock.
- Validate that your balance is updated but the new tokens are locked.
-
Lock/Unlock
- Click on the lock in the bottom left part of the screen, must go to the locked screen asking for the PIN.
- Try to unlock with a wrong PIN.
- Unlock it and check that you transactions were loaded with correct balance.
- Close Hathor Wallet.
- Open again and you should be on the lock screen.
- Unlock it and check that you transactions were loaded with correct balance.
-
Transaction detail
- Click on the first transaction in the list.
- It should appear the transaction data with the output you received with the time until when it's locked.
- Click on the 'Back' link to go back to the main wallet screen.
-
Create new token
- Click on 'Custom tokens', then 'Create a new token'.
- Create a token 'Test Token', 'TST', amount 100.
- Validate its symbol appeared selected in the token bar.
- The list of transactions should have only one, with type 'Token creation' and amount of 100.00.
- Click on the HTR token (in the token bar) and check if the first transaction is of type 'Token deposit' with amount of 1.00.
-
Transaction detail
- Click on the transaction that has the token deposit (this is the transaction responsible for creating the new token).
- Validate it has an input of HTR, an output of the total amount created for the new token, a mint and melt authority output and it might have a change HTR output (depending on the input spent).
- Validate it has the new created token in the token list.
- Validate that all the inputs and outputs from this transaction are from/to addresses that belong to your wallet by checking the "Your address" tag
- Click on the token uid and should redirect to the wallet main screen with TST selected.
- Send 0.01 HTR to the address
WZ7pDnkPnxbs14GHdUFivFzPbzitwNtvZo
- Click on the sent transaction and validate that the 0.01 HTR output does not have the "Your address" tag and that the input and the change output do have
-
Send tokens
- Copy the address.
- Click on 'Send tokens'.
- Send an amount of HTR and TST to the copied address.
- Go back to the main screen and see the transactions list
- The first transaction on the list must have amount 0.00 (for both HTR and TST).
- Click on this transaction and check that it has inputs and outputs for both tokens. And TST must be on the token list.
-
Unregister TST
- Click on the TST uid to redirect to the main screen.
- Click on the trash icon besides the name to unregister the token.
-
Transaction detail
- It should be on the main screen with the HTR selected. Click on the first transaction.
- The token list now has a warning that TST is not registered.
- Click on the uid and register it.
-
Register in the 'Custom tokens' screen
- Click on 'About Test Token' tab.
- Validate that all informations are correct (name, symbol, supply) and copy the configuration string.
- Unregister the token TST.
- Click on 'Custom tokens', then 'Register token'.
- Register the token with the copied string.
- Click on the 'Back' link.
-
Register in the 'number' in the token bar
- Unregister the token again.
- Click on the purple circle on the token token bar with the number 1.
- Click on the 'Show history' and see the transactions of the TST token.
- Click on 'Register tokens' and register it again with the copied configuration string.
-
Administrative tools
- Go back to the wallet main screen and select TST token.
- Click on 'Administrative Tools' tab.
- Total supply and your balance should be 100.00 and you must have 1 mint output and 1 melt output.
- Click to mint tokens.
- Try to mint 10,000.00. It must show an error that you don't have enough HTR for the deposit.
- Mint 50.00 new tokens. The total supply and your balance must be 150.00 now.
- Click to melt tokens.
- Try to melt 200.00 TST. It must show and error that you don't have this amount to melt.
- Melt 20.00 tokens. The total supply and your balance must be 130.00 now.
- Click on 'Balance & History' and copy your address. Then go back to 'Administrative Tools' and click to delegate mint.
- Type your address and delegate. Now you must have 2 mint outputs.
- Click to delegate melt and deselect the option to 'Create another melt output for you?'. Delegate the authority to the address
WZ7pDnkPnxbs14GHdUFivFzPbzitwNtvZo
and now you must have no melt outputs. - Go back to the 'Administrative Tools', click to destroy mint and select 3. You must see an error message that you don't have 3 mint authority outputs.
- Select 2 and complete the destroy. You must see a message saying 'You have no more authority outputs for this token'.
- Go to 'About TST' tab and must see 'Can mint new tokens: No'.
-
Hide Zero-balance tokens
- Go to 'Custom Tokens', then 'Register token'
- Enter the following string: (assuming you are on testnet. If not, create a custom token in another wallet for this test.)
[Hiding Token Test:HIDET:009f4365268aa3083c3bbdabae377fbbf720604e132b58602f6572cf45af8bd5:43f57655]
- Go back to the Main screen and check the the token
HIDET
is now available on the token bar to the left. - Navigate to 'Settings', on the option 'Hide zero-balance tokens', and select 'Change'.
- Confirm that you want to hide zero-balance tokens.
- Navigate back to the tokens screen and check that the token
HIDET
is no longer on the token bar to the left. - Navigate to 'Settings' and de-select the option to 'Hide zero-balance tokens'.
- Navigate back to the tokens screen and check that the token
HIDET
is being shown again.
-
Always show tokens
- Unregister the token
HIDET
- Activate the 'Hide zero-balance tokens' setting on the Settings page
- Go to 'Custom Tokens', then 'Register token' and enter once again the
HIDET
configuration string from above - A message must be shown on screen alerting that you do not have balance on this token.
- This message must also ask if you want to always show this token despite the 'Hide zero-balance tokens' being active
- Select the 'Always show' option and register the token.
- Navigate to the main screen and check that the
HIDET
token is being shown. - Go to the 'About' tab. A line must be informing that the token is always being shown.
- This line also contains a link to change this setting for this token. Click it.
- Confirm that you do not want to always show this token.
- Navigate to the HTR token using the bar on the left.
- Check that the
HIDET
token is no longer being shown on this bar. - Go to the 'Settings' screen and de-activate the 'Hide zero-balance tokens' setting
- Navigate back to the main screen and check that the
HIDET
token is being displayed again on the token bar.
- Unregister the token
-
Token bar scroll
- You should have 3 tokens in your token bar, if you need more you can register the following one:
[Test Coin:TSC:001c382847d8440d05da95420bee2ebeb32bc437f82a9ae47b0745c8a29a7b0d:036e4b2d]
- Reduce the height of your screen and you must see a scroll in the tokens.
- You must continue seeing the lock/settings icons as usual.
- You should have 3 tokens in your token bar, if you need more you can register the following one:
-
Change server
- Click on the 'Wallet' navigation link, then on the settings icon and the on 'Change server'.
- Select one of the default servers and connect. It will connect to the mainnet.
- The transaction list must be empty.
- Go back, change again to the testnet server. Before loading the wallet it must ask to confirm that you want to connect to a testnet. Check that all transactions load again.
-
Add passphrase
- Click on the settings icon and then 'Set a passphrase'.
- Choose any passphrase and confirm it. It must show an empty list again.
- Go back to the passprase screen and now select 'I want to set a blank passphrase.' and confirm it. All transactions must appear again.
-
Notifications and bug report
- Click on the settings icon and 'Change' link on the 'Allow notifications' option. Click to change and see that now it's 'No'.
- Do the same with the bug report to validate it's changing.
-
Reload wallet
- Turn wifi off until the status change to 'Offline'.
- Turn on wifi and check if status change to 'Online' again and the wallet reload the transactions.
- Click on 'Reset all data' and confirm it.
- Now load the wallet with the saved words. All transactions must appear normally.
-
Register tokens with same name
- Unregister TST token but copy its configuration string and save it.
- Click on 'Custom tokens' and then 'Create a new token'.
- Type 'Test token' in the token name, 'test' in the symbol and 200 in the amount.
- Now click on 'Custom tokens', then 'Register a token'.
- Type 'abc'. It should show an error of invalid configuration string.
- Type the configuration string saved in the first step. It must appear an error that you already have a token with this name.
-
Try to spend same output
- Click on 'Wallet' in the navigation bar, select the HTR token and copy the address (and save it).
- Click on the first transaction with amount 0.00.
- Copy the first input from HTR and from your address (copy the transaction ID and the index).
- Click on 'Send tokens'.
- Paste the address and 1.00 as the amount. Deselect 'Choose inputs automatically' and paste the transaction ID and index copied before.
- Must see an error that the output is already spent.
-
Create NFT
- Click on 'Custom tokens', then 'Create an NFT'.
- Fill NFT data as
ipfs://test
, name and symbol as 'NFT Test' and 'NFTT', and amount as 100. Check only the melt authority checkbox. - Double check the Fee is 0.01 HTR, the deposit is 0.01 HTR and the Total is 0.02 HTR.
- Create the NFT and open the transaction on the list.
- Validate that the first output is the data output showing
ipfs://test [Data]
with 0.01 HTR and there is one output with 1.00 of tokens, one output with the melt authority and possibly one change output of HTR.
-
Late backup
- Reset the wallet and close it.
- Open the wallet with the parameters
--unsafe-mode --debug
(see the README.md under "Debug mode on installed app" to understand how). - Click on the application menu Debug > Open Dev Tools. Then type
localStorage.clear()
. This is to simulate a fresh install of the app. - Close and open the wallet again and start a new wallet one without doing backup. It must show a yellow warning saying a backup must be done.
- Do the backup (following procedures in the 'Initialization' tests). The backup message has to disappear.
-
Reset menu
- Click on the application menu Debug > Reset all data. Then fill the form with "anything" and click on the "Reset all data" button.
- Check that a message with "Invalid value." appears.
- Click on "Cancel", the modal should close.
- Click on the application menu Debug > Reset all data. Then fill the form with "I want to reset my wallet" and click on the "Reset all data" button. The wallet should close.
- Open the wallet again, it should open the Welcome screen. Do NOT click on "Get started".
- Close the wallet.
-
Hardware wallet migration
- Uninstall the wallet and install the previous version.
- Connect your Ledger device to the computer. The Ledger should be initialized already.
- Start the wallet with the Ledger device and copy the current address.
- Close the wallet and install the latest version.
-
Hardware wallet initialization
- Connect your Ledger device to the computer. The Ledger should be initialized already.
- Open the Hathor app on Ledger.
- On the desktop wallet, mark the checkbox and click 'Get Started'.
- Choose 'Hardware Wallet'.
- Wallet should go through both steps and show 'Step 1/2' and 'Step 2/2'.
- On your Ledger, check it is requesting your authorization.
- Deny the authorization request on Ledger (scroll with left or right and click both buttons on "Reject" step). It should show an error on the wallet.
- Click 'Try again'. It goes through both steps and asks for authorization again.
- Grant authorization request (click both buttons on the "Approve" step). It will proceed to 'Loading transactions' screen.
- Once the wallet is loaded check that the current address match the copied address during "Hardware wallet migration"
-
Ledger wallet screen
- On the main wallet screen, confirm 'Address to receive tokens' is truncated (eg: 'HGZmqThwa6...'). There should be a 'Show full address' button next to it.
- Confirm there's no QR Code button under the truncated address.
- Click on 'Show full address'. A modal will display asking you to compare the address on the wallet and on Ledger.
- Check that the modal cannot be closed, not even by clicking outside it.
- Confirm that both addresses (on wallet and Ledger) are the same. Copy this address on the computed.
- On the Ledger click both buttons on the "Approve" step. Modal should close.
- Send 10.00 HTR from another wallet to the copied address.
- Check that the transaction appears in the list, the balance was updated and the address also changed.
- Click on 'Generate new address' and validate it has changed.
- Confirm again address on the wallet and on Ledger (by clicking 'Show full address').
-
Ledger custom token wallet screen
- On the main wallet screen get another address and send any amount of a custom token to this address.
- Register the token and go to the token wallet screen.
- Check that there is a key icon next to it's name and click the key icon.
- A modal should appear, confirm that the token symbol, name and uid are correct.
- Click the "Sign token" button and check the Ledger device, it should say "Confirm token data".
- Confirm that the symbol, name and uid are correct (use buttons to scroll).
- Click both buttons on the "Reject" step and check that an error message "User denied token on Ledger" appears on the wallet.
- Try to sign the token again but this time click both buttons on the "Accept" step, a success message should show on the wallet.
- After closing the modal, check that that the key icon is now an unclicable checkmark icon and hovering shows the message "Token signed with Ledger".
-
Ledger reset token signature
- Go to settings and click the button "Untrust all tokens on Ledger".
- Read the message and click "Start", the device should show "Reset token signatures".
- Click both buttons on the "Reject" step and check that an error message appears on the wallet.
- Click the "Try again" button and this time click both buttons on the "Approve" step.
- Go to the token wallet screen and check that the checkmark icon is back to a key icon.
-
Ledger send tokens
- On the wallet screen copy 2 different addresses from your wallet.
- Click on 'Send tokens' on the top menu.
- Confirm that the token dropdown list can be clicked and show all tokens.
- Confirm the Timelock checkbox is disabled.
- Try sending a transaction to an invalid address. An error message should show up on the wallet. Nothing should be displayed on Ledger.
- Try sending a transaction with an amount bigger than the one you have. An error message should show up on the wallet. Nothing should be displayed on Ledger.
- Send HTR tokens to both copied addresses in the same transaction (2 outputs). A modal will be displayed asking to confirm operation on Ledger.
- On Ledger, it should show 'Output 1/2' on the first step the address on the second and the amount on the third step (steps being from left to right), then an "Approve" and "Reject" steps. After clicking both buttons on the "Approve", it shows 'Output 2/2' and the other output (address and ammount).
- Clicking both buttons on the "Approve" step one more time will display the confirmation screen. Reject signing the transaction. The modal will hide and an error message should appear on the wallet.
- Click to send the transaction again. This time, approve it on the signing screen. Ledger screen will show 'Processing' for a while and the desktop wallet will display the modal while solving proof of work.
- After transaction is completed, it closes the modal and goes back to main wallet screen. The first transaction on the list must have value 0.00.
- Go to the custom token wallet page and confirm that the key icon is showing next to the name (and not a checkmark).
- If there is a checkmark icon, go to settings and untrust all tokens.
- Click on 'Send tokens' on the top menu again.
- Change the token dropdown to the custom token and try to send any amount. A modal will be displayed saying there are unverified custom tokens and the list should have the custom token added to the transaction.
- Go to the custom token wallet screen and sign the custom token with Ledger (key icon next to the name).
- Go back to the 'Send tokens' screen and click on 'Add another token' button and send HTR to an address and the custom token to the second copied address. Make sure both amounts are less than the balance available. A modal will be displayed asking to confirm operation on Ledger.
- On Ledger you should check that each token is being sent to the correct address then click both buttons on the 'Approve' screen.
- After transaction is completed, it closes the modal and goes back to main wallet screen. The first transaction on the list must have value 0.00.
- Click on the first transaction and confirm that it has 4 outputs. The extra 2 outputs are change outputs and should be marked with 'Your address'.
- Close the wallet and open it again, check the custom token screen of the token used on the last transaction. Make sure that there is a checkmark icon next to the token name.
-
Ledger misc
- Go to the settings screen.
- Click on change server. The usual Change Server screen should show up, but with no PIN field. Change to a new server.
- On the settings screen, click on 'Set a passphrase'. It should show a modal saying the action is not supported and it should be done directly on Ledger.
- Go to Custom Tokens on the top navigation bar. Clicking 'Create a new token' should display a modal saying action is not supported.
- Now click on 'Create an NFT' and should display a modal saying action is not supported.
- Lock wallet. It should go the screen asking to select the wallet type (software or hardware).
- Choose 'Hardware Wallet' and go through the same process again.
- When finished loading the wallet, it should show the same balance and transactions as before locking.
-
Ledger connection
- On Ledger, quit the Hathor app. The desktop wallet should lock (go to wallet type screen). This does not happen instantly.
- Without opening the Hathor app on Ledger, click 'Hardware wallet'. Desktop wallet will stay on 'Step 1/2'.
- Open the Hathor app on Ledger. Wallet should go to 'Step 2/2' after a few seconds and ask for authorization on Ledger.