Skip to content
Permalink
Browse files

fix bug in non-HW case

  • Loading branch information...
SebastienGllmt committed Oct 10, 2019
1 parent 9b832d7 commit 10139ae6166e883b6d9cb6f0973655a4d9a208c5
@@ -432,6 +432,18 @@ export async function migrateFromStorageV1(request: {
})
);
}
const pathToPublic = [{
index: BIP44_PURPOSE,
insert: {},
},
{
index: CARDANO_COINTYPE,
insert: {},
},
{
index: accountIndex,
insert: {},
}];
builder = builder
.addAdhocPublicDeriver(
finalState => ({
@@ -451,27 +463,12 @@ export async function migrateFromStorageV1(request: {
? null
: finalState.privateDeriver.privateDeriverResult.KeyDerivationId,
pathStartLevel: finalState.privateDeriver == null ? 0 : 1,
pathToPublic: [
...(finalState.privateDeriver != null
? []
: [{
index: 0,
insert: {},
}]
),
{
index: BIP44_PURPOSE,
insert: {},
},
{
index: CARDANO_COINTYPE,
insert: {},
},
{
index: accountIndex,
pathToPublic: finalState.privateDeriver != null
? pathToPublic
: [{
index: 0,
insert: {},
},
],
}, ...pathToPublic],
initialDerivations,
hwWalletMetaInsert: request.hwWalletMetaInsert == null
? undefined
@@ -674,7 +674,7 @@ export class AddAdhocPublicDeriver {
PrivateKeyId: keyInfo.public,
Parent: parentId,
// explicitly ignore index for ROOT since it has no index
Index: i === 0 ? null : request.pathToPublic[i].index,
Index: request.pathStartLevel + i === 0 ? null : request.pathToPublic[i].index,
}),
levelInfo: id => ({
KeyDerivationId: id,

0 comments on commit 10139ae

Please sign in to comment.
You can’t perform that action at this time.