Skip to content

Commit

Permalink
code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat committed Aug 30, 2024
1 parent 552bbb4 commit 7fd7ff4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/MobileWalletProtocolListener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const MobileWalletProtocolListener = () => {
useEffect(() => {
if (IS_DEV) {
const removeListener = addDiagnosticLogListener(event => {
console.log('Event:', JSON.stringify(event, null, 2));
logger.debug(`[MobileWalletProtocolListener]: Diagnostic log event: ${JSON.stringify(event, null, 2)}`);
});

return () => removeListener();
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useNonceForDisplay.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { getNextNonce } from '@/state/nonces';
import { ChainId } from '@/networks/types';
import { logger, RainbowError } from '@/logger';

type UseNonceParams = {
isMessageRequest: boolean;
Expand All @@ -21,7 +22,7 @@ export const useNonceForDisplay = ({ isMessageRequest, address, chainId }: UseNo
setNonceForDisplay(nonceAsString);
}
} catch (error) {
console.error('Failed to get nonce for display:', error);
logger.error(new RainbowError(`[useNonceForDisplay]: Failed to get nonce for display: ${error}`));
}
})();
}
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/useSubmitTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Routes from '@/navigation/routesNames';
import { useNavigation } from '@/navigation';
import { RequestSource } from '@/utils/requestNavigationHandlers';
import { SCREEN_FOR_REQUEST_SOURCE } from '@/components/Transactions/constants';
import { logger, RainbowError } from '@/logger';

export const useTransactionSubmission = ({
isBalanceEnough,
Expand All @@ -25,7 +26,7 @@ export const useTransactionSubmission = ({
setIsAuthorizing(true);
await onConfirm();
} catch (error) {
console.error('Error while sending transaction:', error);
logger.error(new RainbowError(`[useTransactionSubmission]: Error while sending transaction: ${error}`));
} finally {
setIsAuthorizing(false);
}
Expand Down
1 change: 0 additions & 1 deletion src/utils/requestNavigationHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ export const handleMobileWalletProtocolRequest = async ({
);
});
} else if (isEthereumAction(action)) {
console.log(JSON.stringify(action, null, 2));
logger.debug(`Processing ethereum action: ${action.method}`);
if (!supportedMobileWalletProtocolActions.includes(action.method)) {
logger.error(new RainbowError(`[handleMobileWalletProtocolRequest]: Unsupported action type ${action.method}`));
Expand Down

0 comments on commit 7fd7ff4

Please sign in to comment.