Skip to content

Commit

Permalink
Merge branch 'develop' into picker-network-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall authored Oct 12, 2023
2 parents 440bb6e + d6d324b commit dbbf64e
Show file tree
Hide file tree
Showing 38 changed files with 889 additions and 143 deletions.
551 changes: 551 additions & 0 deletions .github/scripts/check-issue-template-and-add-labels.ts

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions .github/workflows/check-issue-template-and-add-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check issue template and add labels

on:
issues:
types:
- opened
- edited

jobs:
add-regression-prod-label:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1 # This retrieves only the latest commit.

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: yarn

- name: Install dependencies
run: yarn --immutable

- name: Check issue template and add labels
id: check-issue-template-and-add-labels
env:
LABEL_TOKEN: ${{ secrets.LABEL_TOKEN }}
run: npm run check-issue-template-and-add-labels
2 changes: 1 addition & 1 deletion app/_locales/de/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/el/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/es/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/fr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/hi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/id/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/ja/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/ko/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/pt/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/ru/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/tl/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/tr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/vi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/_locales/zh_CN/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions app/scripts/controllers/transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import {
TRANSACTION_ENVELOPE_TYPE_NAMES,
} from '../../../../shared/lib/transactions-controller-utils';
import { Numeric } from '../../../../shared/modules/Numeric';
import getSnapAndHardwareInfoForMetrics from '../../lib/snap-keyring/metrics';
import TransactionStateManager from './tx-state-manager';
import TxGasUtil from './tx-gas-utils';
import PendingTransactionTracker from './pending-tx-tracker';
Expand Down Expand Up @@ -166,10 +167,12 @@ export default class TransactionController extends EventEmitter {
this.updateEventFragment = opts.updateEventFragment;
this.finalizeEventFragment = opts.finalizeEventFragment;
this.getEventFragmentById = opts.getEventFragmentById;
this.getDeviceModel = opts.getDeviceModel;
this.getAccountType = opts.getAccountType;
this.getTokenStandardAndDetails = opts.getTokenStandardAndDetails;
this.securityProviderRequest = opts.securityProviderRequest;
this.getSelectedAddress = opts.getSelectedAddress;
this.getAccountType = opts.getAccountType;
this.getDeviceModel = opts.getDeviceModel;
this.snapAndHardwareMessenger = opts.snapAndHardwareMessenger;
this.messagingSystem = opts.messenger;
this._hasCompletedOnboarding = opts.hasCompletedOnboarding;

Expand Down Expand Up @@ -2496,8 +2499,6 @@ export default class TransactionController extends EventEmitter {
eip_1559_version: eip1559Version,
gas_edit_type: 'none',
gas_edit_attempted: 'none',
account_type: await this.getAccountType(this.getSelectedAddress()),
device_model: await this.getDeviceModel(this.getSelectedAddress()),
asset_type: assetType,
token_standard: tokenStandard,
transaction_type: transactionType,
Expand All @@ -2511,6 +2512,16 @@ export default class TransactionController extends EventEmitter {
///: END:ONLY_INCLUDE_IN
};

const snapAndHardwareInfo = await getSnapAndHardwareInfoForMetrics(
this.getSelectedAddress,
this.getAccountType,
this.getDeviceModel,
this.snapAndHardwareMessenger,
);

// merge the snapAndHardwareInfo into the properties
Object.assign(properties, snapAndHardwareInfo);

if (transactionContractMethod === contractMethodNames.APPROVE) {
properties = {
...properties,
Expand Down
22 changes: 0 additions & 22 deletions app/scripts/controllers/transactions/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,6 @@ describe('Transaction Controller', function () {
getEventFragmentById: () =>
fragmentExists === false ? undefined : { id: 0 },
getEIP1559GasFeeEstimates: () => undefined,
getAccountType: () => 'MetaMask',
getDeviceModel: () => 'N/A',
securityProviderRequest: () => undefined,
preferencesStore,
messenger: messengerMock,
Expand Down Expand Up @@ -2180,10 +2178,8 @@ describe('Transaction Controller', function () {
referrer: ORIGIN_METAMASK,
source: MetaMetricsTransactionEventSource.User,
transaction_type: TransactionType.simpleSend,
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: null,
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2269,10 +2265,8 @@ describe('Transaction Controller', function () {
referrer: ORIGIN_METAMASK,
source: MetaMetricsTransactionEventSource.User,
transaction_type: TransactionType.simpleSend,
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: null,
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2370,10 +2364,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: MetaMetricsTransactionEventSource.Dapp,
transaction_type: TransactionType.simpleSend,
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: null,
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2461,10 +2453,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: MetaMetricsTransactionEventSource.Dapp,
transaction_type: TransactionType.simpleSend,
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: null,
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2558,10 +2548,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: MetaMetricsTransactionEventSource.Dapp,
transaction_type: TransactionType.simpleSend,
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: null,
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2632,10 +2620,8 @@ describe('Transaction Controller', function () {
eip_1559_version: '0',
gas_edit_attempted: 'none',
gas_edit_type: 'none',
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: null,
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2710,10 +2696,8 @@ describe('Transaction Controller', function () {
eip_1559_version: '0',
gas_edit_attempted: 'none',
gas_edit_type: 'none',
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: ['security_alert_failed'],
security_alert_reason: 'some error',
Expand Down Expand Up @@ -2785,10 +2769,8 @@ describe('Transaction Controller', function () {
eip_1559_version: '0',
gas_edit_attempted: 'none',
gas_edit_type: 'none',
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: ['flagged_as_malicious'],
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2861,10 +2843,8 @@ describe('Transaction Controller', function () {
eip_1559_version: '0',
gas_edit_attempted: 'none',
gas_edit_type: 'none',
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: ['flagged_as_safety_unknown'],
security_alert_reason: BlockaidReason.notApplicable,
Expand Down Expand Up @@ -2945,10 +2925,8 @@ describe('Transaction Controller', function () {
referrer: 'other',
source: MetaMetricsTransactionEventSource.Dapp,
transaction_type: TransactionType.simpleSend,
account_type: 'MetaMask',
asset_type: AssetType.native,
token_standard: TokenStandard.none,
device_model: 'N/A',
transaction_speed_up: false,
ui_customizations: null,
security_alert_reason: BlockaidReason.notApplicable,
Expand Down
Loading

0 comments on commit dbbf64e

Please sign in to comment.