diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index 5301d1b1c..dac1ed40f 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -2385,10 +2385,12 @@ export default class TransactionController extends EventEmitter { uiCustomizations = null; } + /** The transaction status property is not considered sensitive and is now included in the non-anonymous event */ let properties = { chain_id: chainId, referrer, source, + status, network, eip_1559_version: eip1559Version, gas_edit_type: 'none', @@ -2410,7 +2412,6 @@ export default class TransactionController extends EventEmitter { } let sensitiveProperties = { - status, transaction_envelope_type: isEIP1559Transaction(txMeta) ? TRANSACTION_ENVELOPE_TYPE_NAMES.FEE_MARKET : TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, diff --git a/app/scripts/controllers/transactions/index.test.js b/app/scripts/controllers/transactions/index.test.js index 1237c9be3..be2366578 100644 --- a/app/scripts/controllers/transactions/index.test.js +++ b/app/scripts/controllers/transactions/index.test.js @@ -2163,6 +2163,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: null, + status: 'unapproved', }, sensitiveProperties: { default_gas: '0.000031501', @@ -2173,7 +2174,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; @@ -2250,6 +2250,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: null, + status: 'unapproved', }, sensitiveProperties: { default_gas: '0.000031501', @@ -2260,7 +2261,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; @@ -2349,6 +2349,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: null, + status: 'unapproved', }, sensitiveProperties: { default_gas: '0.000031501', @@ -2359,7 +2360,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; @@ -2438,6 +2438,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: null, + status: 'unapproved', }, sensitiveProperties: { default_gas: '0.000031501', @@ -2448,7 +2449,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; @@ -2529,6 +2529,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: null, + status: 'unapproved', }, sensitiveProperties: { gas_price: '2', @@ -2537,7 +2538,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; await txController._trackTransactionMetricsEvent( @@ -2601,6 +2601,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: null, + status: 'unapproved', }, sensitiveProperties: { baz: 3.0, @@ -2611,7 +2612,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; @@ -2675,6 +2675,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: ['flagged_as_malicious'], + status: 'unapproved', }, sensitiveProperties: { baz: 3.0, @@ -2685,7 +2686,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; @@ -2749,6 +2749,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: ['flagged_as_safety_unknown'], + status: 'unapproved', }, sensitiveProperties: { baz: 3.0, @@ -2759,7 +2760,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.LEGACY, - status: 'unapproved', }, }; @@ -2831,6 +2831,7 @@ describe('Transaction Controller', function () { device_model: 'N/A', transaction_speed_up: false, ui_customizations: null, + status: 'unapproved', }, sensitiveProperties: { baz: 3.0, @@ -2842,7 +2843,6 @@ describe('Transaction Controller', function () { transaction_replaced: undefined, first_seen: 1624408066355, transaction_envelope_type: TRANSACTION_ENVELOPE_TYPE_NAMES.FEE_MARKET, - status: 'unapproved', estimate_suggested: GasRecommendations.medium, estimate_used: GasRecommendations.high, default_estimate: 'medium', diff --git a/test/e2e/metrics/transaction-finalized.spec.js b/test/e2e/metrics/transaction-finalized.spec.js index 32c245255..df4cc21d0 100644 --- a/test/e2e/metrics/transaction-finalized.spec.js +++ b/test/e2e/metrics/transaction-finalized.spec.js @@ -263,6 +263,7 @@ describe('Transaction Finalized Event', function () { category: 'Transactions', locale: 'en', environment_type: 'background', + status: 'submitted', }, 'Transaction Submitted event without sensitive properties does not match the expected payload', ); @@ -317,6 +318,7 @@ describe('Transaction Finalized Event', function () { category: 'Transactions', locale: 'en', environment_type: 'background', + status: 'confirmed', }, 'Transaction Finalized event without sensitive properties does not match the expected payload', );