Skip to content

Commit d218327

Browse files
committed
fix: use publicKeyRaw instead of publicKey
1 parent fd4e395 commit d218327

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/background/services/secrets/AddressPublicKey.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ describe('AddressPublicKey', () => {
252252

253253
it('works with "ed25519" curve', async () => {
254254
const derivationPath = `${EVM_BASE_DERIVATION_PATH}/0/0`;
255-
const publicKey = hex.decode('0123456789abcdef');
255+
const publicKeyRaw = hex.decode('0123456789abcdef');
256256
const secrets = {
257257
secretType: SecretType.Mnemonic,
258258
mnemonic: 'testMnemonic',
259259
} as any;
260260

261261
const seedNode = {
262-
derive: jest.fn().mockReturnValue({ publicKey }),
262+
derive: jest.fn().mockReturnValue({ publicKeyRaw }),
263263
} as any;
264264

265265
jest.spyOn(slip10, 'fromMasterSeed').mockReturnValue(seedNode);
@@ -269,7 +269,7 @@ describe('AddressPublicKey', () => {
269269
await AddressPublicKey.fromSecrets(secrets, 'ed25519', derivationPath),
270270
).toEqual(
271271
AddressPublicKey.fromJSON({
272-
key: hex.encode(publicKey),
272+
key: hex.encode(publicKeyRaw),
273273
curve: 'ed25519',
274274
derivationPath,
275275
}),

src/background/services/secrets/AddressPublicKey.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export class AddressPublicKey<HasDerivationPath extends boolean = true> {
195195

196196
case 'ed25519': {
197197
const hdKey = slip10.fromMasterSeed(seed);
198-
key = hex.encode(hdKey.derive(derivationPath).publicKey);
198+
key = hex.encode(hdKey.derive(derivationPath).publicKeyRaw);
199199
break;
200200
}
201201

0 commit comments

Comments
 (0)