-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update pnpcommon README, fix release sdks script, combiner deps (#10463)
update pnpcommon README, release sdks script, combiner deps
- Loading branch information
Showing
17 changed files
with
1,529 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { EncryptionKeySigner } from '@celo/identity/lib/odis/query' | ||
import { AuthenticationMethod } from '@celo/phone-number-privacy-common' | ||
import { | ||
ensureLeading0x, | ||
normalizeAddressWith0x, | ||
privateKeyToAddress, | ||
} from '@celo/utils/lib/address' | ||
|
||
export const PRIVATE_KEY = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' | ||
export const ACCOUNT_ADDRESS = normalizeAddressWith0x(privateKeyToAddress(PRIVATE_KEY)) // 0x1be31a94361a391bbafb2a4ccd704f57dc04d4bb | ||
|
||
interface DEK { | ||
privateKey: string | ||
publicKey: string | ||
address: string | ||
} | ||
|
||
export const deks: DEK[] = [ | ||
{ | ||
privateKey: 'bf8a2b73baf8402f8fe906ad3f42b560bf14b39f7df7797ece9e293d6f162188', | ||
publicKey: '034846bc781cacdafc66f3a77aa9fc3c56a9dadcd683c72be3c446fee8da041070', | ||
address: '0x7b33dF2607b85e3211738a49A6Ad6E8Ed4d13F6E', | ||
}, | ||
{ | ||
privateKey: '0975b0c565abc75b6638a749ea3008cb52676af3eabe4b80e19c516d82330364', | ||
publicKey: '03b1ac8c445f0796978018c087b97e8213b32c39e6a8642ae63dce71da33a19f65', | ||
address: '0x34332049B07Fab9a2e843A7C8991469d93cF6Ae6', | ||
}, | ||
] | ||
|
||
// The following code can be used to generate more test DEKs | ||
// const generateDEKs = (n: number): Promise<DEK[]> => Promise.all([...Array(n).keys()].map( | ||
// async () => await deriveDek(await generateMnemonic()) | ||
// )) | ||
|
||
export const dekAuthSigner = (index: number): EncryptionKeySigner => { | ||
return { | ||
authenticationMethod: AuthenticationMethod.ENCRYPTION_KEY, | ||
rawKey: ensureLeading0x(deks[index].privateKey), | ||
} | ||
} | ||
|
||
export function generateRandomPhoneNumber() { | ||
const min = 1000000000 // Smallest 10-digit number | ||
const max = 9999999999 // Largest 10-digit number | ||
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min | ||
return '+1' + randomNumber.toString() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.