1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

moving some properties to identifiable payload (#11506)

This commit is contained in:
Brad Decker 2021-07-12 17:30:35 -05:00 committed by ryanml
parent 609ef9a09c
commit 12e7089363
2 changed files with 34 additions and 24 deletions

View File

@ -1087,13 +1087,15 @@ export default class TransactionController extends EventEmitter {
this._trackMetaMetricsEvent({ this._trackMetaMetricsEvent({
event, event,
category: 'Transactions', category: 'Transactions',
sensitiveProperties: { properties: {
type, chain_id: chainId,
status,
referrer, referrer,
source, source,
network, network,
chain_id: chainId, type,
},
sensitiveProperties: {
status,
transaction_envelope_type: isEIP1559Transaction(txMeta) transaction_envelope_type: isEIP1559Transaction(txMeta)
? 'fee-market' ? 'fee-market'
: 'legacy', : 'legacy',

View File

@ -1212,17 +1212,19 @@ describe('Transaction Controller', function () {
const expectedPayload = { const expectedPayload = {
event: 'Transaction Added', event: 'Transaction Added',
category: 'Transactions', category: 'Transactions',
sensitiveProperties: { properties: {
chain_id: '0x2a', chain_id: '0x2a',
network: '42',
referrer: 'metamask',
source: 'user',
type: 'sentEther',
},
sensitiveProperties: {
gas_price: '2', gas_price: '2',
gas_limit: '0x7b0d', gas_limit: '0x7b0d',
first_seen: 1624408066355, first_seen: 1624408066355,
transaction_envelope_type: 'legacy', transaction_envelope_type: 'legacy',
network: '42',
referrer: 'metamask',
source: 'user',
status: 'unapproved', status: 'unapproved',
type: 'sentEther',
}, },
}; };
@ -1257,17 +1259,19 @@ describe('Transaction Controller', function () {
const expectedPayload = { const expectedPayload = {
event: 'Transaction Added', event: 'Transaction Added',
category: 'Transactions', category: 'Transactions',
sensitiveProperties: { properties: {
chain_id: '0x2a', chain_id: '0x2a',
network: '42',
referrer: 'other',
source: 'dapp',
type: 'sentEther',
},
sensitiveProperties: {
gas_price: '2', gas_price: '2',
gas_limit: '0x7b0d', gas_limit: '0x7b0d',
first_seen: 1624408066355, first_seen: 1624408066355,
transaction_envelope_type: 'legacy', transaction_envelope_type: 'legacy',
network: '42',
referrer: 'other',
source: 'dapp',
status: 'unapproved', status: 'unapproved',
type: 'sentEther',
}, },
}; };
@ -1302,19 +1306,21 @@ describe('Transaction Controller', function () {
const expectedPayload = { const expectedPayload = {
event: 'Transaction Added', event: 'Transaction Added',
category: 'Transactions', category: 'Transactions',
properties: {
network: '42',
referrer: 'other',
source: 'dapp',
type: 'sentEther',
chain_id: '0x2a',
},
sensitiveProperties: { sensitiveProperties: {
baz: 3.0, baz: 3.0,
foo: 'bar', foo: 'bar',
chain_id: '0x2a',
gas_price: '2', gas_price: '2',
gas_limit: '0x7b0d', gas_limit: '0x7b0d',
first_seen: 1624408066355, first_seen: 1624408066355,
transaction_envelope_type: 'legacy', transaction_envelope_type: 'legacy',
network: '42',
referrer: 'other',
source: 'dapp',
status: 'unapproved', status: 'unapproved',
type: 'sentEther',
}, },
}; };
@ -1354,20 +1360,22 @@ describe('Transaction Controller', function () {
const expectedPayload = { const expectedPayload = {
event: 'Transaction Added', event: 'Transaction Added',
category: 'Transactions', category: 'Transactions',
properties: {
chain_id: '0x2a',
network: '42',
referrer: 'other',
source: 'dapp',
type: 'sentEther',
},
sensitiveProperties: { sensitiveProperties: {
baz: 3.0, baz: 3.0,
foo: 'bar', foo: 'bar',
chain_id: '0x2a',
max_fee_per_gas: '2', max_fee_per_gas: '2',
max_priority_fee_per_gas: '2', max_priority_fee_per_gas: '2',
gas_limit: '0x7b0d', gas_limit: '0x7b0d',
first_seen: 1624408066355, first_seen: 1624408066355,
transaction_envelope_type: 'fee-market', transaction_envelope_type: 'fee-market',
network: '42',
referrer: 'other',
source: 'dapp',
status: 'unapproved', status: 'unapproved',
type: 'sentEther',
}, },
}; };