Skip to content

Commit

Permalink
fix: use publicKeyRaw instead of publicKey
Browse files Browse the repository at this point in the history
  • Loading branch information
meeh0w committed Feb 17, 2025
1 parent fd4e395 commit d218327
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/background/services/secrets/AddressPublicKey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ describe('AddressPublicKey', () => {

it('works with "ed25519" curve', async () => {
const derivationPath = `${EVM_BASE_DERIVATION_PATH}/0/0`;
const publicKey = hex.decode('0123456789abcdef');
const publicKeyRaw = hex.decode('0123456789abcdef');
const secrets = {
secretType: SecretType.Mnemonic,
mnemonic: 'testMnemonic',
} as any;

const seedNode = {
derive: jest.fn().mockReturnValue({ publicKey }),
derive: jest.fn().mockReturnValue({ publicKeyRaw }),
} as any;

jest.spyOn(slip10, 'fromMasterSeed').mockReturnValue(seedNode);
Expand All @@ -269,7 +269,7 @@ describe('AddressPublicKey', () => {
await AddressPublicKey.fromSecrets(secrets, 'ed25519', derivationPath),
).toEqual(
AddressPublicKey.fromJSON({
key: hex.encode(publicKey),
key: hex.encode(publicKeyRaw),
curve: 'ed25519',
derivationPath,
}),
Expand Down
2 changes: 1 addition & 1 deletion src/background/services/secrets/AddressPublicKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class AddressPublicKey<HasDerivationPath extends boolean = true> {

case 'ed25519': {
const hdKey = slip10.fromMasterSeed(seed);
key = hex.encode(hdKey.derive(derivationPath).publicKey);
key = hex.encode(hdKey.derive(derivationPath).publicKeyRaw);
break;
}

Expand Down

0 comments on commit d218327

Please sign in to comment.