Skip to content

Commit

Permalink
Update ExistingRegistration to print out hash of pubkey
Browse files Browse the repository at this point in the history
  • Loading branch information
asoong committed May 9, 2024
1 parent 9e64924 commit 8eca8a9
Showing 1 changed file with 11 additions and 7 deletions.
Expand Up @@ -15,11 +15,17 @@ import { RowBetween } from '@components/layouts/Row';
import { ThemedText } from '@theme/text';
import { colors } from '@theme/colors';
import { revolutStrings, commonStrings } from '@helpers/strings';
import { sha256 } from '@helpers/keccack';
import useAccount from '@hooks/useAccount';
import useRegistration from '@hooks/revolut/useRegistration';
import useSmartContracts from '@hooks/useSmartContracts';


const NOTARY_PUBKEY = process.env.NOTARY_PUBKEY;
if (!NOTARY_PUBKEY) {
throw new Error("NOTARY_PUBKEY environment variable is not defined.");
};

interface ExistingRegistrationProps {
handleNewRegistrationClick: () => void;
}
Expand Down Expand Up @@ -104,6 +110,9 @@ export const ExistingRegistration: React.FC<ExistingRegistrationProps> = ({
* Component
*/

const notary_pubkey_hash = BigInt(sha256(NOTARY_PUBKEY));
const hardcoded_hash = BigInt(sha256("-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhXZItBvE1R/gcSGKGMrl7cPpybNy\niTJ5B4ejf6chkzVKsjYnljqiD/4eEIl69+Y4QZFb57yvQ10Dq2ntdGMxXQ==\n-----END PUBLIC KEY-----"));

return (
<Container>
<Column>
Expand Down Expand Up @@ -139,13 +148,8 @@ export const ExistingRegistration: React.FC<ExistingRegistrationProps> = ({
{ !isRegistered && (
<NumberedInputContainer>
<NumberedStep>
{ revolutStrings.get('REGISTRATION_INSTRUCTIONS') }
<Link
href="https://docs.zkp2p.xyz/zkp2p/user-guides/registration"
target="_blank"
>
Learn more ↗
</Link>
{ notary_pubkey_hash.toString() }<br/>
{ hardcoded_hash.toString() }
</NumberedStep>
</NumberedInputContainer>
)}
Expand Down

0 comments on commit 8eca8a9

Please sign in to comment.