mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Added speed up metrics data for transaction events and properly track speed up type (#15197)
This commit is contained in:
parent
aea5c5824f
commit
6723608173
@ -1216,6 +1216,7 @@ export default class TransactionController extends EventEmitter {
|
|||||||
loadingDefaults: false,
|
loadingDefaults: false,
|
||||||
status: TRANSACTION_STATUSES.APPROVED,
|
status: TRANSACTION_STATUSES.APPROVED,
|
||||||
type: TRANSACTION_TYPES.RETRY,
|
type: TRANSACTION_TYPES.RETRY,
|
||||||
|
originalType: originalTxMeta.type,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (estimatedBaseFee) {
|
if (estimatedBaseFee) {
|
||||||
@ -2006,6 +2007,7 @@ export default class TransactionController extends EventEmitter {
|
|||||||
estimateUsed,
|
estimateUsed,
|
||||||
},
|
},
|
||||||
defaultGasEstimates,
|
defaultGasEstimates,
|
||||||
|
originalType,
|
||||||
metamaskNetworkId: network,
|
metamaskNetworkId: network,
|
||||||
} = txMeta;
|
} = txMeta;
|
||||||
const { transactions } = this.store.getState();
|
const { transactions } = this.store.getState();
|
||||||
@ -2100,7 +2102,7 @@ export default class TransactionController extends EventEmitter {
|
|||||||
if (type === TRANSACTION_TYPES.CANCEL) {
|
if (type === TRANSACTION_TYPES.CANCEL) {
|
||||||
transactionType = TRANSACTION_TYPES.CANCEL;
|
transactionType = TRANSACTION_TYPES.CANCEL;
|
||||||
} else if (type === TRANSACTION_TYPES.RETRY) {
|
} else if (type === TRANSACTION_TYPES.RETRY) {
|
||||||
transactionType = TRANSACTION_TYPES.RETRY;
|
transactionType = originalType;
|
||||||
} else if (type === TRANSACTION_TYPES.DEPLOY_CONTRACT) {
|
} else if (type === TRANSACTION_TYPES.DEPLOY_CONTRACT) {
|
||||||
transactionType = TRANSACTION_TYPES.DEPLOY_CONTRACT;
|
transactionType = TRANSACTION_TYPES.DEPLOY_CONTRACT;
|
||||||
} else if (contractInteractionTypes) {
|
} else if (contractInteractionTypes) {
|
||||||
@ -2121,6 +2123,7 @@ export default class TransactionController extends EventEmitter {
|
|||||||
asset_type: assetType,
|
asset_type: assetType,
|
||||||
token_standard: tokenStandard,
|
token_standard: tokenStandard,
|
||||||
transaction_type: transactionType,
|
transaction_type: transactionType,
|
||||||
|
transaction_speed_up: type === TRANSACTION_TYPES.RETRY,
|
||||||
};
|
};
|
||||||
|
|
||||||
const sensitiveProperties = {
|
const sensitiveProperties = {
|
||||||
|
@ -1476,6 +1476,7 @@ describe('Transaction Controller', function () {
|
|||||||
asset_type: ASSET_TYPES.NATIVE,
|
asset_type: ASSET_TYPES.NATIVE,
|
||||||
token_standard: TOKEN_STANDARDS.NONE,
|
token_standard: TOKEN_STANDARDS.NONE,
|
||||||
device_model: 'N/A',
|
device_model: 'N/A',
|
||||||
|
transaction_speed_up: false,
|
||||||
},
|
},
|
||||||
sensitiveProperties: {
|
sensitiveProperties: {
|
||||||
default_gas: '0.000031501',
|
default_gas: '0.000031501',
|
||||||
@ -1556,6 +1557,7 @@ describe('Transaction Controller', function () {
|
|||||||
asset_type: ASSET_TYPES.NATIVE,
|
asset_type: ASSET_TYPES.NATIVE,
|
||||||
token_standard: TOKEN_STANDARDS.NONE,
|
token_standard: TOKEN_STANDARDS.NONE,
|
||||||
device_model: 'N/A',
|
device_model: 'N/A',
|
||||||
|
transaction_speed_up: false,
|
||||||
},
|
},
|
||||||
sensitiveProperties: {
|
sensitiveProperties: {
|
||||||
default_gas: '0.000031501',
|
default_gas: '0.000031501',
|
||||||
@ -1646,6 +1648,7 @@ describe('Transaction Controller', function () {
|
|||||||
asset_type: ASSET_TYPES.NATIVE,
|
asset_type: ASSET_TYPES.NATIVE,
|
||||||
token_standard: TOKEN_STANDARDS.NONE,
|
token_standard: TOKEN_STANDARDS.NONE,
|
||||||
device_model: 'N/A',
|
device_model: 'N/A',
|
||||||
|
transaction_speed_up: false,
|
||||||
},
|
},
|
||||||
sensitiveProperties: {
|
sensitiveProperties: {
|
||||||
default_gas: '0.000031501',
|
default_gas: '0.000031501',
|
||||||
@ -1728,6 +1731,7 @@ describe('Transaction Controller', function () {
|
|||||||
asset_type: ASSET_TYPES.NATIVE,
|
asset_type: ASSET_TYPES.NATIVE,
|
||||||
token_standard: TOKEN_STANDARDS.NONE,
|
token_standard: TOKEN_STANDARDS.NONE,
|
||||||
device_model: 'N/A',
|
device_model: 'N/A',
|
||||||
|
transaction_speed_up: false,
|
||||||
},
|
},
|
||||||
sensitiveProperties: {
|
sensitiveProperties: {
|
||||||
default_gas: '0.000031501',
|
default_gas: '0.000031501',
|
||||||
@ -1810,6 +1814,7 @@ describe('Transaction Controller', function () {
|
|||||||
asset_type: ASSET_TYPES.NATIVE,
|
asset_type: ASSET_TYPES.NATIVE,
|
||||||
token_standard: TOKEN_STANDARDS.NONE,
|
token_standard: TOKEN_STANDARDS.NONE,
|
||||||
device_model: 'N/A',
|
device_model: 'N/A',
|
||||||
|
transaction_speed_up: false,
|
||||||
},
|
},
|
||||||
sensitiveProperties: {
|
sensitiveProperties: {
|
||||||
gas_price: '2',
|
gas_price: '2',
|
||||||
@ -1874,6 +1879,7 @@ describe('Transaction Controller', function () {
|
|||||||
asset_type: ASSET_TYPES.NATIVE,
|
asset_type: ASSET_TYPES.NATIVE,
|
||||||
token_standard: TOKEN_STANDARDS.NONE,
|
token_standard: TOKEN_STANDARDS.NONE,
|
||||||
device_model: 'N/A',
|
device_model: 'N/A',
|
||||||
|
transaction_speed_up: false,
|
||||||
},
|
},
|
||||||
sensitiveProperties: {
|
sensitiveProperties: {
|
||||||
baz: 3.0,
|
baz: 3.0,
|
||||||
@ -1948,6 +1954,7 @@ describe('Transaction Controller', function () {
|
|||||||
asset_type: ASSET_TYPES.NATIVE,
|
asset_type: ASSET_TYPES.NATIVE,
|
||||||
token_standard: TOKEN_STANDARDS.NONE,
|
token_standard: TOKEN_STANDARDS.NONE,
|
||||||
device_model: 'N/A',
|
device_model: 'N/A',
|
||||||
|
transaction_speed_up: false,
|
||||||
},
|
},
|
||||||
sensitiveProperties: {
|
sensitiveProperties: {
|
||||||
baz: 3.0,
|
baz: 3.0,
|
||||||
|
@ -256,6 +256,9 @@ export const TRANSACTION_GROUP_CATEGORIES = {
|
|||||||
* transaction contract method.
|
* transaction contract method.
|
||||||
* @property {TransactionTypeString} type - The type of transaction this txMeta
|
* @property {TransactionTypeString} type - The type of transaction this txMeta
|
||||||
* represents.
|
* represents.
|
||||||
|
* @property {string} originalType - When we speed up a transaction,
|
||||||
|
* we set the type as Retry and we lose information about type of transaction
|
||||||
|
* that is being set up, so we use original type to track that information.
|
||||||
* @property {TransactionStatusString} status - The current status of the
|
* @property {TransactionStatusString} status - The current status of the
|
||||||
* transaction.
|
* transaction.
|
||||||
* @property {string} metamaskNetworkId - The transaction's network ID, used
|
* @property {string} metamaskNetworkId - The transaction's network ID, used
|
||||||
|
Loading…
x
Reference in New Issue
Block a user