Skip to content

Commit

Permalink
formatting and license
Browse files Browse the repository at this point in the history
  • Loading branch information
mozrt2 committed Jan 12, 2024
1 parent b32f35d commit c98ebe8
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const project = new typescript.TypeScriptProject({

// github
github: true,
authorName: 'Fluidkey',
authorName: 'Fluid Privacy SA',
authorEmail: '[email protected]',
gitignore: ['.idea/', '.env', '.yalc'],
license: 'MIT',

// NPMjs Configuration
authorOrganization: true,
Expand Down
2 changes: 0 additions & 2 deletions LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/extractViewingPrivateKeyNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export function extractViewingPrivateKeyNode(
// Convert the private viewing key to Uint8Array
const uint8PrivateViewingKey = toBytes(privateViewingKey);

// generate the master HDKey from the private viewing key
// Generate the master HDKey from the private viewing key
const hdkey = HDKey.fromMasterSeed(uint8PrivateViewingKey);

// derive the node m/5564'/N to be shared with the server
// Derive the node m/5564'/N to be shared with the server
return hdkey.derive(`m/5564'/${node}'`);
}
1 change: 1 addition & 0 deletions src/predictStealthSafeAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import * as chains from 'viem/chains';
* @param transport (optional) a custom viem transport to use for the simulation
* @return Promise<{ stealthSafeAddress }> the predicted Safe address (not deployed)
*/

export async function predictStealthSafeAddress({
chainId,
threshold,
Expand Down
6 changes: 6 additions & 0 deletions test/extractViewingPrivateKeyNode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ describe('extractPrivateViewingKeyNode', () => {
expect(Array.from(result.privateKey!)).toEqual(expectedPrivateKey);
expect(Array.from(result.publicKey!)).toEqual(expectedPublicKey);
});

it('should throw an error if the private viewing key is not a valid hex string', () => {
expect(() => extractViewingPrivateKeyNode('0xinvalid')).toThrow(
'Hex private viewing key is not valid.',
);
});
});

0 comments on commit c98ebe8

Please sign in to comment.