1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

158 Commits

Author SHA1 Message Date
Frederik Bolding
012e9fab9d
Improve transaction confirmation page performance (#16205)
* Reduce the amount of calls to insight snaps

* Add dep

* Update LavaMoat policies

* Fix selectors and revert changes to hook

* Remove dep

* Revert "Update LavaMoat policies"

This reverts commit 7469c94e0e7c52eb877766a96005cc559c9d8d20.
2022-10-28 10:37:33 +02:00
ryanml
0bc1eeaf37
Deprecating the Rinkeby, Ropsten, and Kovan test networks (#15989)
* Deprecating Rinkeby, setting default debug network to Goerli

* Deprecating Ropsten and Kovan

* Conflict fix

* Remove unused localization, test fixes

* Add migration for moving used deprecated testnets to custom networks

* Fix migrator test

* Add more unit tests

* Migration updates provider type to rpc if deprecated network is selected

* Migration fully and correctly updates the provider if selected network is a deprecated testnet

* Continue to show deprecation warning on each of rinkeby, ropsten and kovan

* Add rpcUrl deprecation message to loading screen

* Removing mayBeFauceting prop

Co-authored-by: Dan Miller <danjm.com@gmail.com>
2022-09-28 20:26:01 -07:00
Alex Donesky
34fe20126a
bump smart-transactions-controller verion (#15818) 2022-09-27 16:44:38 -05:00
Frederik Bolding
4eb8e50800
[FLASK] snaps-skunkworks@0.21.0 (#15889)
* snaps-skunkworks@0.21.0

* Update policy files

* Regen policies again

* Fix tests

* Simplify selector

* Fix flaky test

* Update iframe execution env

* Move snap install warnings to util

* Add basic copy for snap_getBip32PublicKey

* Update permission icon

* Update E2Es

* Fix lint

* Fix locale strings
2022-09-23 12:39:54 +02:00
Guillaume Roux
c9dc59ea2a
[FLASK] Snaps Insight (#15814)
Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
Co-authored-by: Hassan Malik <41640681+hmalik88@users.noreply.github.com>
2022-09-20 19:00:07 +02:00
Filip Sekulic
6e13524bcd
Remove related UI code from the app dir (#15384)
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-09-16 14:05:21 -05:00
Brad Decker
c87980bbfe
migrate network constants to typescript (#15610) 2022-09-14 09:55:31 -05:00
Daniel
34e2faaf49
Replace Rinkeby with Goerli for dev testing (#15781) 2022-09-12 13:11:29 +02:00
Niranjana Binoy
4512a9e151
Using formatIconUrlWithProxy to get the iconUrl proxy of swap token (#15562) 2022-08-22 15:16:57 -04:00
Niranjana Binoy
d09bdbe3df
the token detction change affected swap performace, this is fixing it (#15607) 2022-08-17 11:38:06 -05:00
Niranjana Binoy
8949f36639
Updating useMemo dependency list (#15572) 2022-08-15 09:25:57 -05:00
Daniel
2eb0fe6978
Add more tracking for MetaMask (#15462) 2022-08-11 19:33:33 +02:00
Niranjana Binoy
6e5c2f03bf
Token detection V2 Flag Removal and Re-introducing the use of legacy token list when token detection is OFF (#15138)
* addding the legacy tokenlist, tuning token detection OFF by default, adding new message while importing tokens

updating the controller version and calling detectNewToken on network change

fixing rebase error

Run yarn lavamoat:auto for updating policies

updating lavamoat

Deleted node modules and run again lavamoat auto

fixing rebase issues

updating lavamoat policies

updating lavamoat after rebasing

policies

updating custom token warning and blocking detectedtoken link when tpken detection is off for supported networks

to update the token in fetchTosync

updating the contract map object

Revert build-system lavamoat policy changes

Move token list selection logic from components to getTokenList selector

updating the tokenList

Update lavamoat

Fix error

updating lavamoat

lint fix

fix unit test fail

fix unit test fail

lint fix

fixing rebase locale error

rebase fix

Revert build-system policy changes

temp

addressing review comments

* rebase fix
2022-08-09 22:56:25 -02:30
George Marshall
0692f7bf25
Updating content to sentence case and updating tests (#15285) 2022-08-08 12:01:38 -07:00
Alex Donesky
fc304680d4
Fix error that occurs when attempting to display transaction value for an approval transaction with no value argument in the transaction data (#15398) 2022-08-01 11:42:58 -05:00
Brad Decker
c72199a1a6
update prettier (#15360) 2022-07-31 13:26:40 -05:00
Daniel
f31bac9fbf
Performance improvements for Swaps (#15359) 2022-07-28 15:56:15 +02:00
Brad Decker
652d631cda
remove exclusions for mismatched object jsdoc type casing (#15351) 2022-07-27 08:28:05 -05:00
Brad Decker
1db0ee87ec
Update Eslint and deps (#15293) 2022-07-26 13:10:51 -05:00
Alex Donesky
8536c86ed5
Improve tokenId parsing and clean up useAssetDetails hook (#15304) 2022-07-23 09:37:31 -05:00
Filip Sekulic
7d321c48e0
Removed ui related code from shared directory (#15252) 2022-07-19 11:07:13 -05:00
Alex Donesky
4f0115fcdc
Add setApprovalForAll confirmation view (#15010)
* enhance setApprovalForAll confirmation flow

* cleanup

* address feedback
2022-07-11 18:32:55 -05:00
Alex Donesky
b170211700
Fix to infinite loading on approve screen (#14756) 2022-06-11 12:55:35 -05:00
Ariella Vu
b6ade44bc9
Slight cleanup of constants/transactions, useTransactionDisplayData, and TransactionIcon (#14784)
* TransactionIcon: alphabetize categories

* useTransactionDisplayData: rm repetitive comment

* useTransactionDisplayData: mv signatureTypes

* useTxDisplayData: import transactionGroup @typedef

* userTxDisplayData: just vertical line spacing
2022-05-26 16:26:45 -05:00
Ariella Vu
70bdd9729f
Enables the "Safe Transaction From" copy for safeTransferFrom transactions (#14769)
* useTransactionDisplayData:support safetransferfrom

* useTransactionDisplayData: update test
2022-05-25 10:13:15 -05:00
Alex Donesky
5e55cf2cf2
add case in useTransactionDisplayData to handle transaction type safeTransferFrom (#14678)
* add case in useTransactionDisplayData to handle transaction type safeTransferFrom

* add test
2022-05-12 10:02:08 -05:00
Frederik Bolding
3b3a680682
Stop using 4bytes for contract deployment (#14598) 2022-05-02 16:49:01 -05:00
Alex Donesky
fbeae57247
Add testnet name as prefix for native currency of preloaded testnets (#14454)
* add testnet name as prefix for native currency of preloaded testnets
2022-04-21 14:09:41 -05:00
Daniel
eed6ae2b8c
Swaps: Sort "token_from" dropdown tokens by their fiat value first and "token_to" by top tokens (#14436) 2022-04-15 14:57:58 +02:00
Dan J Miller
b7b041c43b
Fix speed-up/cancel: don't update existing transaction data (#14355)
* Fix speed-up/cancel: don't update existing transaction data

* Move retryTxMeta state management to useGasFeeInputs.js

* Handle initial retryTxMeta set if no transaction is passed to useGasFeeInputs

* Ensure previousGas is use on retry transaction if it is available in useGasFeeInputs

* Remove update transaction mock and correctly test gas fee increase scenarios now that updateTransaction used in cancel-speedup is defined on the front end
2022-04-14 13:20:48 -02:30
Guillaume Roux
4b3977044f
Swap : Fix undefined icon url (#14411) 2022-04-13 14:18:35 +02:00
Niranjana Binoy
07231e42b2
Update token detection logic to only control auto-detection (#14251) 2022-04-06 13:59:16 -04:00
Dan J Miller
09512c7148
Improvements for multi-layer fee UX (#13547)
* Show fiat on confirm screen on multilayer-fee network

* Disable gas editing on optimism

* Fix send max mode on optimism

* Represent layer 2 gas fee as a single value

* Hide gas fee edit UI on optimism

* Improvement multilayer-fee-message styling

* Lint fix

* Fix locales

* Remove unnecessary code change

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2022-03-29 16:51:45 -02:30
Olusegun Akintayo
c54f9b3097
update gas fees (#13646)
* Draft methods to brak updateTransaction into smaller more targeted
methods.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* This is a combination of 76 commits.

normalize and validate tx params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Method to normalize tx and check if it's unapproved.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move the methods to controllers/transactions/index.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Flesh out the methods to update transaction with custom notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

enforce that only the properties for the specific methid can be updated via the method.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Test update gas fees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

use lodash to remove undefined properties
update swap transaction tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Updates transaction user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add more parameters to updateSwapTransaction
    approvalTxId
    estimatedBaseFee

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add Update Transaction Metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update transaction gas fees actions.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update EIP 1559 Params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint Fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Documentations.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics from this PR

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes: Removed unused variables

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add more params to updateTransactionGasFees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update eip1559 method to editableParams.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix Mocha tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

add gasPrice to updateEditableParams

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove duplicated Params in notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

A few more tests to cover if
    transaction status is not unapproved
    transaction is passed more parameters than it requires.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update Transaction Gas Fees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update gas fees in edit-gas-popover.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update gas settings and user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix unit tests.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Draft methods to brak updateTransaction into smaller more targeted
methods.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

normalize and validate tx params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Method to normalize tx and check if it's unapproved.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Move the methods to controllers/transactions/index.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Flesh out the methods to update transaction with custom notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Test update gas fees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update swap approval transaction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

use lodash to remove undefined properties
update swap transaction tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Updates transaction user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add Update Transaction Metrics

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update transaction gas fees actions.js

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update EIP 1559 Params.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint Fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Documentations.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics from this PR

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes: Removed unused variables

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Add more params to updateTransactionGasFees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update eip1559 method to editableParams.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix Mocha tests

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

add gasPrice to updateEditableParams

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove duplicated Params in notes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

A few more tests to cover if
    transaction status is not unapproved
    transaction is passed more parameters than it requires.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update Transaction Gas Fees.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove metrics.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Update gas settings and user settings.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Fix unit tests.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Remove dup;icated method from rebase.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

unrelated change

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Force re-run workflow

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fix

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Do not hideLoading since we're not showing it.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

UpdateTransaction should be renamed to updateGasFees

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

updateGasFees in gas-modal-page-container.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

fix:
    update previous gas params update method
    add types to the jsdoc comments.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

updateTransactionGasFees should have been updatePreviousGasParams

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Previous gas fees can be updated for confirmed transactions.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

add updatePreviousGasParams to mocked functions.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* we need to await the first dispatch before we call the second

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* update values to make tests pass

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* More changes to make e2e pass

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Need to wait a bit after save for changes to take effect.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Remove merge comments.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Await one dispatch before calling another

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* We don't need goHome anymore.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Tests must use async...await syntax too since we have await in the
useTranasctionFunction

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Add delay after button click for values to update

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Wait a moment after clicking save for values to update

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Wait after clicking save...

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Merge update transaction gas fees and transaction user settings
Show loading indicator on edit gas popover
Fix tests.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Lint fixes

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* Fix JSDoc

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>

* updatePreviousGasParams should also return updated transaction meta.

Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2022-03-25 21:11:04 +04:00
VSaric
30ef26101a
Remove the useSegmentContext function from metametrics.new.js (#14013) 2022-03-25 09:26:09 -05:00
VSaric
5564176d72
Remove usages of useNewMetricEvent hook (#13955) 2022-03-25 08:21:29 -05:00
Alex Donesky
e3ea4f2cd0
Fix issue where we show contract address as recipient when calling safe transfer method on erc721 or erc1155 contracts (#13535)
* fix issue where we show contract address as recipient when calling safe transfer method on erc721 or erc1155 contracts

* updates function name getTransactionData -> parseStandardTokenTransactionData, and adds documentation
2022-03-17 13:35:40 -05:00
Ariella Vu
69c2cd3a94
Permissions: convert hook to util (#13906)
* Permissions: convert hook into helper util
- instantiate once
- freeze
- alphabetize
- add additional comments to @param
https://github.com/MetaMask/metamask-extension/pull/13906#pullrequestreview-906554847
2022-03-14 15:26:02 -03:00
VSaric
060c6d651c
Remove usages of useMetricEvent hook (#13930) 2022-03-14 13:12:38 -05:00
Alex Donesky
3747ace06b
Refactor token send/method confirmation flow (trimmed down) (#13788)
* make use of getTokenStandardAndDetails method exposed on assetsContractController to determine how to represent the contract being interacted with in token contract method calls
2022-03-09 08:38:12 -06:00
Brad Decker
9cea401022
extract determineTransactionType from tx controller (#13737) 2022-03-07 12:54:36 -06:00
Ariella Vu
aa89bb189b
Fix v10.11: Unable to find value of key "eth_accounts" for locale "en" in Permissions Modal (#13833)
* ConnectedAccountsPermissions: convert to FC

* permissions: add usePermissionsDescriptions
- fix ConnectedAccountsPermissions eth_accounts i18n

* ConnectedAccountsPermissions: rm .component
from path

* ConnectedAccountsPermissions: fix toggleExpanded

ensure we change previous state value

Co-authored-by: Mark Stacey <markjstacey@gmail.com>

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-03-04 13:56:31 -03:00
Jyoti Puri
6e8f4a6a76
gas fee details displayed on UI should be used gas estimates if available (#13809) 2022-03-03 05:52:46 +05:30
Jyoti Puri
137b47370e
Confirm transaction page: show contract address details in title (#13683) 2022-03-02 20:56:53 +05:30
Erik Marks
35ac762e10
Add Snaps via Flask (#13462)
This PR adds `snaps` under Flask build flags to the extension. This branch is mostly equivalent to the current production version of Flask, excepting some bug fixes and tweaks.

Closes #11626
2022-02-14 16:02:51 -08:00
Jyoti Puri
a06a0d21e0
Adding check for transaction.id in useTransactionEventFragment hook (#13587) 2022-02-10 22:00:34 +05:30
Daniel
8166d50578
Resolve a BigNumber issue (#13555)
* Do not call `decimalToHex` for `minimumGasLimit`, which is already in hex

* Add `0x` prefix when returning a gas estimate

* Fix UTs

Co-authored-by: Dan J Miller <danjm.com@gmail.com>
2022-02-08 14:44:50 -03:30
Jyoti Puri
760ed3457d
Removing EIP_1559_V2 feature flag (#13481) 2022-02-03 05:58:28 +05:30
Jyoti Puri
cc1861a34e
Adding metrics events for EIP-1559 V2 flow (#13329) 2022-02-01 23:23:03 +05:30
Alex Donesky
dc217dd536
Yet more NFT UX cleanups (#13435)
* yet more nft ux cleanups
2022-01-31 12:56:49 -06:00