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

Update transaction status to not be considered anonymous (#20049)

* update transaction status to not be considered anonymous

* fix failing e2e

* revert status changes in txn spec file

* Fix e2e by adding status

---------

Co-authored-by: Olusegun Akintayo <akintayo.segun@gmail.com>
This commit is contained in:
Sylva Elendu 2023-07-28 19:08:59 +01:00 committed by GitHub
parent 0efc63784d
commit 1a218714a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 10 deletions

View File

@ -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,

View File

@ -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',

View File

@ -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',
);