1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Group signature transactions (#11016)

This commit is contained in:
David Walsh 2021-05-11 12:57:06 -05:00 committed by GitHub
parent 89ef78674d
commit 77f0ff8e83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,5 @@
import { MESSAGE_TYPE } from './app';
/**
* Transaction Type is a MetaMask construct used internally
* @typedef {Object} TransactionTypes
@ -51,6 +53,11 @@ export const TRANSACTION_TYPES = {
DEPLOY_CONTRACT: 'contractDeployment',
SWAP: 'swap',
SWAP_APPROVAL: 'swapApproval',
SIGN: MESSAGE_TYPE.ETH_SIGN,
SIGN_TYPED_DATA: MESSAGE_TYPE.ETH_SIGN_TYPED_DATA,
PERSONAL_SIGN: MESSAGE_TYPE.PERSONAL_SIGN,
ETH_DECRYPT: MESSAGE_TYPE.ETH_DECRYPT,
ETH_GET_ENCRYPTION_PUBLIC_KEY: MESSAGE_TYPE.ETH_GET_ENCRYPTION_PUBLIC_KEY,
};
/**

View File

@ -145,7 +145,17 @@ export function useTransactionDisplayData(transactionGroup) {
// 6. Swap
// 7. Swap Approval
if (type === null || type === undefined) {
const signatureTypes = [
null,
undefined,
TRANSACTION_TYPES.SIGN,
TRANSACTION_TYPES.PERSONAL_SIGN,
TRANSACTION_TYPES.SIGN_TYPED_DATA,
TRANSACTION_TYPES.ETH_DECRYPT,
TRANSACTION_TYPES.ETH_GET_ENCRYPTION_PUBLIC_KEY,
];
if (signatureTypes.includes(type)) {
category = TRANSACTION_GROUP_CATEGORIES.SIGNATURE_REQUEST;
title = t('signatureRequest');
subtitle = origin;