Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent confirm screen from showing method name from contract registry for txes created within MetaMask #15472

Merged
merged 2 commits into from Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1054,7 +1054,10 @@ export default class ConfirmTransactionBase extends Component {
} = this.getNavigateTxData();

let functionType;
if (txData.type === TRANSACTION_TYPES.CONTRACT_INTERACTION) {
if (
txData.type === TRANSACTION_TYPES.CONTRACT_INTERACTION &&
txData.origin !== 'metamask'
) {
functionType = getMethodName(name);
}

Expand Down
12 changes: 8 additions & 4 deletions ui/pages/confirm-transaction/confirm-transaction.component.js
Expand Up @@ -68,7 +68,7 @@ export default class ConfirmTransaction extends Component {
sendTo,
history,
mostRecentOverviewPage,
transaction: { txParams: { data } = {} } = {},
transaction: { txParams: { data } = {}, origin } = {},
getContractMethodData,
transactionId,
paramsTransactionId,
Expand All @@ -91,7 +91,9 @@ export default class ConfirmTransaction extends Component {
return;
}

getContractMethodData(data);
if (origin !== 'metamask') {
getContractMethodData(data);
}

const txId = transactionId || paramsTransactionId;
if (txId) {
Expand All @@ -107,7 +109,7 @@ export default class ConfirmTransaction extends Component {
componentDidUpdate(prevProps) {
const {
setTransactionToConfirm,
transaction: { txData: { txParams: { data } = {} } = {} },
transaction: { txData: { txParams: { data } = {}, origin } = {} },
clearConfirmTransaction,
getContractMethodData,
paramsTransactionId,
Expand All @@ -124,8 +126,10 @@ export default class ConfirmTransaction extends Component {
prevProps.paramsTransactionId !== paramsTransactionId
) {
clearConfirmTransaction();
getContractMethodData(data);
setTransactionToConfirm(paramsTransactionId);
if (origin !== 'metamask') {
getContractMethodData(data);
}
} else if (
prevProps.transactionId &&
!transactionId &&
Expand Down