From 16c3f57c15e2d3a06d2935ca545876f584dea359 Mon Sep 17 00:00:00 2001 From: digiwand <20778143+digiwand@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:08:44 -0800 Subject: [PATCH] revert: decoding metrics on old SignatureRequest --- .../components/SignatureRequest/index.js | 34 +++---------------- .../components/TypedSign/index.js | 6 ++-- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/app/components/Views/confirmations/components/SignatureRequest/index.js b/app/components/Views/confirmations/components/SignatureRequest/index.js index aec69d3020a..bccde7b1d36 100644 --- a/app/components/Views/confirmations/components/SignatureRequest/index.js +++ b/app/components/Views/confirmations/components/SignatureRequest/index.js @@ -22,8 +22,6 @@ import WebsiteIcon from '../../../../UI/WebsiteIcon'; import { getSignatureDecodingEventProps } from '../../utils/signatureMetrics'; import BlockaidBanner from '../BlockaidBanner/BlockaidBanner'; import { ResultType } from '../BlockaidBanner/BlockaidBanner.types'; -import { selectTypedSignSimulationEnabled } from '../../../../../selectors/signatureController'; -import { selectPendingApprovals } from '../../../../../selectors/approvalController'; const getCleanUrl = (url) => { try { @@ -146,14 +144,6 @@ class SignatureRequest extends PureComponent { * Object containing current page title and url */ currentPageInformation: PropTypes.object, - /** - * Whether signature simulation with decoding API is enabled - */ - isSimulationEnabled: PropTypes.bool, - /** - * Signature request object - */ - signatureRequest: PropTypes.object, /** * String representing signature type */ @@ -229,18 +219,7 @@ class SignatureRequest extends PureComponent { }; componentDidMount = () => { - const { currentPageInformation, isSimulationEnabled, type, fromAddress, signatureRequest } = this.props; - - const eventProps = { - ...getAnalyticsParams( - { - currentPageInformation, - from: fromAddress, - }, - type, - ), - ...getSignatureDecodingEventProps(signatureRequest, isSimulationEnabled), - }; + const { currentPageInformation, type, fromAddress } = this.props; this.props.metrics.trackEvent( this.props.metrics @@ -324,22 +303,21 @@ class SignatureRequest extends PureComponent { }; onContactUsClicked = () => { - const { fromAddress, isSimulationEnabled, type, signatureRequest } = this.props; + const { fromAddress, type } = this.props; - const eventProps = { + const analyticsParams = { ...getAnalyticsParams( { from: fromAddress, }, type, ), - ...getSignatureDecodingEventProps(signatureRequest, isSimulationEnabled), external_link_clicked: 'security_alert_support_link', }; this.props.metrics.trackEvent( this.props.metrics .createEventBuilder(MetaMetricsEvents.SIGNATURE_REQUESTED) - .addProperties(eventProps) + .addProperties(analyticsParams) .build(), ); }; @@ -423,10 +401,8 @@ class SignatureRequest extends PureComponent { } const mapStateToProps = (state) => ({ - isSimulationEnabled: selectTypedSignSimulationEnabled(state, Object.values(selectPendingApprovals(state) || {})[0]?.id), - securityAlertResponse: state.signatureRequest.securityAlertResponse, selectedAddress: selectSelectedInternalAccountFormattedAddress(state), - signatureRequest: Object.values(selectPendingApprovals(state) || {})[0], + securityAlertResponse: state.signatureRequest.securityAlertResponse, }); SignatureRequest.contextType = ThemeContext; diff --git a/app/components/Views/confirmations/components/TypedSign/index.js b/app/components/Views/confirmations/components/TypedSign/index.js index c56dc4c52bf..ac2484cd970 100644 --- a/app/components/Views/confirmations/components/TypedSign/index.js +++ b/app/components/Views/confirmations/components/TypedSign/index.js @@ -15,7 +15,6 @@ import { sanitizeString, } from '../../../../../util/string'; -import { getSignatureDecodingEventProps } from '../../utils/signatureMetrics'; import { addSignatureErrorListener, getAnalyticsParams, @@ -115,16 +114,19 @@ class TypedSign extends PureComponent { metrics, } = this.props; +<<<<<<< Updated upstream const eventProps = { ...getAnalyticsParams(messageParams, 'typed_sign'), ...getSignatureDecodingEventProps(messageParams), }; +======= +>>>>>>> Stashed changes metrics.trackEvent( MetricsEventBuilder.createEventBuilder( MetaMetricsEvents.SIGNATURE_REQUESTED, ) - .addProperties(eventProps) + .addProperties(getAnalyticsParams(messageParams, 'typed_sign')) .build(), ); addSignatureErrorListener(metamaskId, this.onSignatureError);