Skip to content

Commit

Permalink
Pass in pubkey hash instead of hashing env
Browse files Browse the repository at this point in the history
  • Loading branch information
asoong committed May 9, 2024
1 parent 629c045 commit ccfbac7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions client/.env.default
Expand Up @@ -24,6 +24,7 @@ USE_GARANTI=true

REMOTE_NOTARY_VERIFICATION_URL=your_remote_notary_verification_url
NOTARY_VERIFICATION_SIGNING_KEY=your_verification_signing_key
NOTARY_PUBKEY_HASH=your_notary_pubkey_hash
USE_REVOLUT=true

REVOLUT_DEFAULT_DEPOSITOR_REGISTRATION_PROOF=valid_registration_proof
Expand Down
1 change: 1 addition & 0 deletions client/config/webpack.config.js
Expand Up @@ -677,6 +677,7 @@ module.exports = function (webpackEnv) {
'process.env.REMOTE_NOTARY_VERIFICATION_URL': JSON.stringify(process.env.REMOTE_NOTARY_VERIFICATION_URL),
'process.env.NOTARY_VERIFICATION_SIGNING_KEY': JSON.stringify(process.env.NOTARY_VERIFICATION_SIGNING_KEY),
'process.env.NOTARY_PUBKEY': JSON.stringify(process.env.NOTARY_PUBKEY),
'process.env.NOTARY_PUBKEY_HASH': JSON.stringify(process.env.NOTARY_PUBKEY_HASH),

'process.env.USE_REVOLUT_DEFAULT_DEPOSITOR': JSON.stringify(process.env.USE_REVOLUT_DEFAULT_DEPOSITOR),
'process.env.REVOLUT_DEFAULT_DEPOSITOR_REGISTRATION_PROOF': JSON.stringify(process.env.REVOLUT_DEFAULT_DEPOSITOR_REGISTRATION_PROOF),
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/Deposit/revolut/NewPosition.tsx
Expand Up @@ -14,7 +14,7 @@ import { LoginStatus, NewRevolutDepositTransactionStatus } from '@helpers/types'
import { calculateConversionRate, toBigInt, toUsdcString } from '@helpers/units';
import { ZERO } from '@helpers/constants';
import { revolutStrings } from '@helpers/strings';
import { keccak256, sha256, calculateRevolutTagHash } from '@helpers/keccack';
import { keccak256, calculateRevolutTagHash } from '@helpers/keccack';
import { MODALS } from '@helpers/types';
import { NOTARY_VERIFICATION_SIGNING_KEY } from '@helpers/notary';
import useAccount from '@hooks/useAccount';
Expand All @@ -26,9 +26,9 @@ import useSmartContracts from '@hooks/useSmartContracts';
import useModal from '@hooks/useModal';


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

interface NewPositionProps {
Expand Down Expand Up @@ -86,7 +86,7 @@ export const NewPosition: React.FC<NewPositionProps> = ({
toBigInt(depositAmountInput.toString()),
toBigInt(receiveAmountInput.toString()),
NOTARY_VERIFICATION_SIGNING_KEY,
sha256(NOTARY_PUBKEY)
NOTARY_PUBKEY_HASH
],
enabled: shouldConfigureNewDepositWrite
});
Expand Down

0 comments on commit ccfbac7

Please sign in to comment.