-
-
Notifications
You must be signed in to change notification settings - Fork 5
fix(29917): Trezor accounts not able to add multiple HD path accounts into the account list #187
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
Changes from all commits
ee26c9b
17968b7
776292e
7614a99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,6 +133,15 @@ describe('TrezorKeyring', function () { | |
}); | ||
}); | ||
|
||
describe('getModel', function () { | ||
it('gets bridge model', async function () { | ||
keyring.bridge.model = 'foo'; | ||
const model = keyring.getModel(); | ||
|
||
expect(model).toBe('foo'); | ||
}); | ||
}); | ||
|
||
describe('init', function () { | ||
it('initialises the bridge', async function () { | ||
const initStub = sinon.stub().resolves(); | ||
|
@@ -720,18 +729,11 @@ describe('TrezorKeyring', function () { | |
expect(keyring.paths).toStrictEqual(mockPaths); | ||
}); | ||
|
||
it('should update the hdPath and reset account and page properties if passed a new hdPath', async function () { | ||
it('should update the hdPath if passed a new hdPath', async function () { | ||
const SLIP0044TestnetPath = `m/44'/1'/0'/0`; | ||
|
||
keyring.setHdPath(SLIP0044TestnetPath); | ||
|
||
expect(keyring.hdPath).toBe(SLIP0044TestnetPath); | ||
expect(keyring.accounts).toStrictEqual([]); | ||
expect(keyring.page).toBe(0); | ||
expect(keyring.perPage).toBe(5); | ||
expect(keyring.hdk.publicKey).toBeNull(); | ||
expect(keyring.unlockedAccount).toBe(0); | ||
expect(keyring.paths).toStrictEqual({}); | ||
Comment on lines
-729
to
-734
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we test that these ones are unchanged instead? |
||
}); | ||
|
||
it('should throw an error if passed an unsupported hdPath', async function () { | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -539,11 +539,6 @@ export class TrezorKeyring extends EventEmitter { | |||
// Reset HDKey if the path changes | ||||
if (this.hdPath !== hdPath) { | ||||
this.hdk = new HDKey(); | ||||
mikesposito marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
this.accounts = []; | ||||
this.page = 0; | ||||
this.perPage = 5; | ||||
this.unlockedAccount = 0; | ||||
this.paths = {}; | ||||
Comment on lines
-542
to
-546
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will the keyring still be able to sign transactions with the accounts previously derived with a different path? Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, previously derived accounts are not able to sign or send tx. I guess i need to check what we're doing with Ledger keyring as it's working there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's warranted to add a test case for this scenario as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the LedgerKeyring stores a map of
|
||||
} | ||||
this.hdPath = hdPath; | ||||
} | ||||
|
Uh oh!
There was an error while loading. Please reload this page.