Skip to content

Commit

Permalink
chore: add TODOs to derived account methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ShookLyngs committed Nov 11, 2022
1 parent 890b275 commit c9ca3e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions scripts/account-faucet/src/utils/derived.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export interface DerivedAccount {
privateKey: HexString;
ethAddress: Address;
}

// TODO: private-key has a max-limit, maybe we should generate derived accounts with hd-wallet
export function privateKeyToDerivedAccounts(privateKey: HexString, count: number): DerivedAccount[] {
if (count > 64) {
throw new Error('you can only generate up to 64 derived accounts from a private-key');
Expand Down
6 changes: 2 additions & 4 deletions scripts/light-godwoken-cli/src/utils/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ export interface DerivedAccount {
privateKey: HexString;
ethAddress: Address;
}
export function privateKeyToDerivedAccounts(privateKey: HexString, count: number): DerivedAccount[] {
if (count > 64) {
throw new Error('you can only generate up to 64 derived accounts from a private-key');
}

// TODO: private-key has a max-limit, maybe we should generate derived accounts with hd-wallet
export function privateKeyToDerivedAccounts(privateKey: HexString, count: number): DerivedAccount[] {
const keys = [addHexPrefix(privateKey)];
for (let i = 0; i < count; i++) {
const newKey = '0x' + keccak256(keys[keys.length - 1]).toString('hex');
Expand Down

0 comments on commit c9ca3e0

Please sign in to comment.