Skip to content

Commit

Permalink
fixup! fix quotes and test in fixes from github
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBenc committed Mar 6, 2024
1 parent ab81cfa commit f2233e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/curves/ed25519Bip32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ export const getPublicKey = async (
/**
* Adds a tweak to a public key.
*
* @param _publicKey - The public key.
* @param _tweak - The tweak to add.
* @param publicKey - The public key.
* @param tweak - The tweak to add.
* @returns The resulting public key.
*/
export const publicAdd = (
publicKey: Uint8Array,
tweak: Uint8Array,
): Uint8Array => {
return ed25519.ExtendedPoint.fromHex(remove0x(bytesToHex(_publicKey)))
.add(ed25519.ExtendedPoint.fromHex(remove0x(bytesToHex(_tweak))))
return ed25519.ExtendedPoint.fromHex(remove0x(bytesToHex(publicKey)))
.add(ed25519.ExtendedPoint.fromHex(remove0x(bytesToHex(tweak))))
.toRawBytes();
};

Expand Down
2 changes: 1 addition & 1 deletion src/derivers/cip3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export async function deriveChildKey(

assert(
!isHardened,
"Invalid parameters: Cannot derive hardened child keys without a private key.",
'Invalid parameters: Cannot derive hardened child keys without a private key.',
);

const parentNode = {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,11 @@ describe('getFingerprint', () => {

it('throws if the public key is not a valid Uint8Array', () => {
expect(() => getFingerprint(new Uint8Array(33).fill(0), 33)).toThrow(
'Invalid public key: The key must be 33 byte, non-zero byte array.',
'Invalid public key: The key must be a 33-byte, non-zero byte array.',
);

expect(() => getFingerprint(new Uint8Array(65).fill(1), 33)).toThrow(
'Invalid public key: The key must be 33 byte, non-zero byte array.',
'Invalid public key: The key must be a 33-byte, non-zero byte array.',
);
});
});
Expand Down

0 comments on commit f2233e5

Please sign in to comment.