Unverified Commit d477983a authored by Hanwen Cheng's avatar Hanwen Cheng Committed by GitHub
Browse files

fix: consistently use network root account as default created account (#654)

* fix: consistently use network root account as default created account

* fix e2e test
parent 12a7624f
Pipeline #100424 failed with stages
in 2 minutes and 59 seconds
......@@ -114,25 +114,6 @@ export default function NetworkSelector({
return availableNetworks.includes(networkKey);
};
const deriveSubstrateSeedRootPath = async (
networkKey: string
): Promise<void> => {
await unlockSeedPhrase(navigation, seedRefHooks.isSeedRefValid);
const fullPath = '';
try {
await accounts.deriveNewPath(
fullPath,
seedRefHooks.substrateAddress,
networkKey,
'Root',
''
);
navigateToPathDetails(navigation, networkKey, fullPath);
} catch (error) {
alertPathDerivationError(error.message);
}
};
const deriveSubstrateNetworkRootPath = async (
networkKey: string,
networkParams: SubstrateNetworkParams
......@@ -218,11 +199,7 @@ export default function NetworkSelector({
): Promise<void> => {
if (isNew || shouldShowMoreNetworks) {
if (isSubstrateNetworkParams(networkParams)) {
if (isNew) {
await deriveSubstrateSeedRootPath(networkKey);
} else {
await deriveSubstrateNetworkRootPath(networkKey, networkParams);
}
await deriveSubstrateNetworkRootPath(networkKey, networkParams);
} else {
await deriveEthereumAccount(networkKey);
}
......
......@@ -14,8 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { by, element } from 'detox';
import {
EthereumNetworkKeys,
SUBSTRATE_NETWORK_LIST,
......@@ -26,7 +24,6 @@ import {
pinCode,
tapBack,
testExist,
testInput,
testRecoverIdentity,
testScrollAndTap,
testTap,
......@@ -38,7 +35,6 @@ import testIDs from 'e2e/testIDs';
const {
Main,
PathDerivation,
PathDetail,
PathsList,
SecurityHeader,
......@@ -68,20 +64,12 @@ describe('Signing ane exporting test', () => {
testRecoverIdentity();
describe('Kusama Signing Test', () => {
it('Recover a Kusama signing account', async () => {
await testTap(PathsList.deriveButton);
await testInput(PathDerivation.pathInput, '');
await testInput(PathDerivation.nameInput, 'kusama root');
await element(by.text('Done')).tap();
await testExist(PathsList.pathCard + '//kusama');
});
it('is able to export the signing account', async () => {
await testTap(PathsList.pathCard + '//kusama');
await testTap(PathDetail.popupMenuButton);
await testTap(PathDetail.exportButton);
await testExist(
'secret:0xdf46d55a2d98695e9342b67edae6669e5c0b4e1a3895f1adf85989565b9ab827:0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe:kusama root'
'secret:0xdf46d55a2d98695e9342b67edae6669e5c0b4e1a3895f1adf85989565b9ab827:0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe:Kusama root'
);
await tapBack();
await testVisible(PathDetail.screen);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment