Skip to content

Commit

Permalink
revert: decoding metrics on old SignatureRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
digiwand committed Jan 17, 2025
1 parent 0f8456d commit 16c3f57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(),
);
};
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
sanitizeString,
} from '../../../../../util/string';

import { getSignatureDecodingEventProps } from '../../utils/signatureMetrics';
import {
addSignatureErrorListener,
getAnalyticsParams,
Expand Down Expand Up @@ -115,16 +114,19 @@ class TypedSign extends PureComponent {
metrics,
} = this.props;

<<<<<<< Updated upstream

Check failure on line 117 in app/components/Views/confirmations/components/TypedSign/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint:tsc)

Merge conflict marker encountered.
const eventProps = {
...getAnalyticsParams(messageParams, 'typed_sign'),
...getSignatureDecodingEventProps(messageParams),
};

=======

Check failure on line 123 in app/components/Views/confirmations/components/TypedSign/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint:tsc)

Merge conflict marker encountered.
>>>>>>> Stashed changes

Check failure on line 124 in app/components/Views/confirmations/components/TypedSign/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint:tsc)

Merge conflict marker encountered.
metrics.trackEvent(
MetricsEventBuilder.createEventBuilder(
MetaMetricsEvents.SIGNATURE_REQUESTED,
)
.addProperties(eventProps)
.addProperties(getAnalyticsParams(messageParams, 'typed_sign'))
.build(),
);
addSignatureErrorListener(metamaskId, this.onSignatureError);
Expand Down

0 comments on commit 16c3f57

Please sign in to comment.